code: public static boolean isInteger(String number) {
          boolean result = false;
          try {
              Integer.parseInt(number);
              result = true;
          } catch (NumberFormatException e) {
          }
          return result;
      }
docs: Checks if a string is a valid integer
  
  @param number The string to check
  @return True if the string is a valid integer else false.