code: public static Integer toInteger(String string) {
      if (string == null) {
        return null;
      }
  
      try {
        return parseInt(string);
      } catch (Exception e) {
        return null;
      }
    }
docs: Returns an {@code Integer} representation of the given {@code string}, or {@code null} if it's not a valid
  {@code Integer}.
  
  @param string
  The string to process.
  @return The {@code Integer} representation of {@code string}, or {@code null} if {@code string} is {@code null} or
  not a valid {@code Integer}.