code: public int getParamInt(String paramName, int defaultValue) {
          Object paramValue = getParam(paramName);
          if (paramValue == null) {
              return defaultValue;
          }
          try {
              return Integer.parseInt(paramValue.toString());
          } catch (Exception e) {
              throw new IllegalArgumentException("Value for parameter '" + paramName + "' must be an integer: " + paramValue);
          }
      }
docs: Get the value of the parameter with the given name belonging to this service as an
  integer. If the parameter is not found, the given default value is returned. If the
  parameter is found but cannot be converted to an integer, an
  IllegalArgumentException is thrown.
  
  @param paramName     Name of parameter to find.
  @param defaultValue  Value to return if parameter is not defined.
  @return              Defined or default value.