@Test public void testIsValidNumber() { assertThat(isValidNumber(Long.MAX_VALUE)).isTrue(); assertThat(isValidNumber(Long.MIN_VALUE)).isTrue(); assertThat(isValidNumber(Double.MIN_VALUE)).isTrue(); assertThat(isValidNumber(Double.MAX_VALUE)).isTrue(); assertThat(isValidNumber(Float.MAX_VALUE)).isTrue(); assertThat(isValidNumber(Float.MIN_VALUE)).isTrue(); assertThat(isValidNumber(0L)).isTrue(); assertThat(isValidNumber(0D)).isTrue(); assertThat(isValidNumber(0)).isTrue(); assertThat(isValidNumber(0x0F)).isTrue(); assertThat(isValidNumber("1")).isTrue(); assertThat(isValidNumber("1.00")).isTrue(); assertThat(isValidNumber("-1.00")).isTrue(); assertThat(isValidNumber("-1")).isTrue(); assertThat(isValidNumber(Double.NaN)).isFalse(); assertThat(isValidNumber(Double.POSITIVE_INFINITY)).isFalse(); assertThat(isValidNumber(Double.NEGATIVE_INFINITY)).isFalse(); assertThat(isValidNumber(String.valueOf(Double.NaN))).isFalse(); assertThat(isValidNumber(String.valueOf(Double.POSITIVE_INFINITY))).isFalse(); assertThat(isValidNumber(String.valueOf(Double.NEGATIVE_INFINITY))).isFalse(); assertThat(isValidNumber(Float.NaN)).isFalse(); assertThat(isValidNumber(Float.POSITIVE_INFINITY)).isFalse(); assertThat(isValidNumber(Float.NEGATIVE_INFINITY)).isFalse(); assertThat(isValidNumber(String.valueOf(Float.NaN))).isFalse(); assertThat(isValidNumber(String.valueOf(Float.POSITIVE_INFINITY))).isFalse(); assertThat(isValidNumber(String.valueOf(Float.NEGATIVE_INFINITY))).isFalse(); }
public static boolean isValidNumber(Object value) { if (value == null) { return false; } if (value instanceof Number) { return isValidNumber((Number) value); } if (value instanceof String) { return isNumeric(value); } return false; }
NumberUtils { public static boolean isValidNumber(Object value) { if (value == null) { return false; } if (value instanceof Number) { return isValidNumber((Number) value); } if (value instanceof String) { return isNumeric(value); } return false; } }
NumberUtils { public static boolean isValidNumber(Object value) { if (value == null) { return false; } if (value instanceof Number) { return isValidNumber((Number) value); } if (value instanceof String) { return isNumeric(value); } return false; } private  NumberUtils(); }
NumberUtils { public static boolean isValidNumber(Object value) { if (value == null) { return false; } if (value instanceof Number) { return isValidNumber((Number) value); } if (value instanceof String) { return isNumeric(value); } return false; } private  NumberUtils(); static boolean isNumeric(Object value); static boolean isValidNumber(Object value); static boolean isValidNumber(Number number); }
NumberUtils { public static boolean isValidNumber(Object value) { if (value == null) { return false; } if (value instanceof Number) { return isValidNumber((Number) value); } if (value instanceof String) { return isNumeric(value); } return false; } private  NumberUtils(); static boolean isNumeric(Object value); static boolean isValidNumber(Object value); static boolean isValidNumber(Number number);  }