@Test public void testIsNumeric() { assertThat(isNumeric(null)).isFalse(); assertThat(isNumeric("")).isTrue(); assertThat(isNumeric(" ")).isFalse(); assertThat(isNumeric("123")).isTrue(); assertThat(isNumeric("12 3")).isFalse(); assertThat(isNumeric("ab2c")).isFalse(); assertThat(isNumeric("12-3")).isFalse(); assertThat(isNumeric("12.3")).isTrue(); assertThat(isNumeric("12.3.3.3")).isFalse(); assertThat(isNumeric(".2")).isTrue(); assertThat(isNumeric(".")).isFalse(); assertThat(isNumeric(1L)).isTrue(); assertThat(isNumeric(2)).isTrue(); assertThat(isNumeric((Object) "3.2")).isTrue(); assertThat(isNumeric((Object) "abc")).isFalse(); assertThat(isNumeric(FALSE)).isFalse(); assertThat(isNumeric(String.valueOf(Double.NEGATIVE_INFINITY))).isFalse(); }
public static boolean isNumeric(Object value) { if (value == null) return false; if (value instanceof Number) return true; if (value instanceof String) { String stringValue = (String) value; if (isNullOrEmpty(stringValue)) return true; return isNumber(stringValue); } return false; }
NumberUtils { public static boolean isNumeric(Object value) { if (value == null) return false; if (value instanceof Number) return true; if (value instanceof String) { String stringValue = (String) value; if (isNullOrEmpty(stringValue)) return true; return isNumber(stringValue); } return false; } }
NumberUtils { public static boolean isNumeric(Object value) { if (value == null) return false; if (value instanceof Number) return true; if (value instanceof String) { String stringValue = (String) value; if (isNullOrEmpty(stringValue)) return true; return isNumber(stringValue); } return false; } private  NumberUtils(); }
NumberUtils { public static boolean isNumeric(Object value) { if (value == null) return false; if (value instanceof Number) return true; if (value instanceof String) { String stringValue = (String) value; if (isNullOrEmpty(stringValue)) return true; return isNumber(stringValue); } return false; } private  NumberUtils(); static boolean isNumeric(Object value); static boolean isValidNumber(Object value); static boolean isValidNumber(Number number); }
NumberUtils { public static boolean isNumeric(Object value) { if (value == null) return false; if (value instanceof Number) return true; if (value instanceof String) { String stringValue = (String) value; if (isNullOrEmpty(stringValue)) return true; return isNumber(stringValue); } return false; } private  NumberUtils(); static boolean isNumeric(Object value); static boolean isValidNumber(Object value); static boolean isValidNumber(Number number);  }