code: public static Integer toInteger(String parameterValue) {
          Integer result = null;
          if (isDigits(parameterValue))
              result = Integer.valueOf(parameterValue);
          return result;
      }
docs: Parses a parameter as an Integer. This is useful for working with query
  string parameters and path segments as numbers.
  
  @param parameterValue The String to parse.
  @return If the string is made up of digits only, an Integer parsed from
  the string. Otherwise null.