MCPcopy Create free account
hub / github.com/banq/jdonframework / isSignedLong

Method isSignedLong

src/main/java/com/jdon/util/UtilValidate.java:353–363  ·  view source on GitHub ↗

Returns true if all characters are numbers; first character is allowed to be + or - as well. Does not accept floating point, exponential notation, etc.

(String s)

Source from the content-addressed store, hash-verified

351 * Does not accept floating point, exponential notation, etc.
352 */
353 public static boolean isSignedLong(String s) {
354 if (isEmpty(s)) return defaultEmptyOK;
355
356 try {
357 Long.parseLong(s);
358
359 return true;
360 } catch (Exception e) {
361 return false;
362 }
363 }
364
365 /** Returns true if string s is an integer > 0. NOTE: using the Java Long object for greatest precision */
366 public static boolean isPositiveInteger(String s) {

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected