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