code: public static int getInteger(String pStr, int defval) {
          if (isEmpty(pStr)) return defval;
          try {
              return Integer.parseInt(pStr);
          } catch (NumberFormatException nm) {
              return defval;
          }
      }
docs: Returns the parsed integer value for the passed in String.
  
  @param pStr A String value.
  
  @return An integer value.
  
  @see Integer#parseInt(java.lang.String)