code: private int getIntValue(String str, int defaultValue) {
  
          try {
              int intValue = Integer.parseInt(str);
              return (intValue > 0) ? intValue : defaultValue;
          } catch (NumberFormatException e) {
              // intentionally left blank
          }
          return defaultValue;
      }
docs: Turns a string into an int.<p>
  
  @param str the string to be converted
  @param defaultValue a default value to be returned in case the string could not be parsed or the parsed int value is <= 0
  @return the int value of the string