/** * Evaluates the given object as a String. * * @param value * an object to interpret as a String * @return the String value implied by the given object as returned by the toString() method, or * "null" if the object is null. */ public static String stringValue(Object value) { return stringValue(value, false); }
/** * Evaluates the given object as a String. * * @param value * an object to interpret as a String * @return the String value implied by the given object as returned by the toString() method, or * "null" if the object is null. */ public static String stringValue(final Object value) { return stringValue(value, false); }
/** * Evaluates the given object as a String. * * @param value * an object to interpret as a String * @return the String value implied by the given object as returned by the toString() method, or * "null" if the object is null. */ public static String stringValue(Object value) { return stringValue(value, false); }
String s = stringValue(value, true);
/** * Evaluates the given object as a long integer. * * @param value * an object to interpret as a long integer * @return the long integer value implied by the given object * @throws NumberFormatException * if the given object can't be understood as a long integer */ public static long longValue(Object value) throws NumberFormatException { if (value == null) { return 0L; } Class c = value.getClass(); if (c.getSuperclass() == Number.class) { return ((Number)value).longValue(); } if (c == Boolean.class) { return ((Boolean)value).booleanValue() ? 1 : 0; } if (c == Character.class) { return ((Character)value).charValue(); } return Long.parseLong(stringValue(value, true)); }
/** * The formatting for {@link Locale#ENGLISH} might not be compatible with HTML (e.g. group * digits), thus use {@link Objects#stringValue(Object)} instead. * * @return value */ @Override protected String getModelValue() { N value = getModelObject(); if (value == null) { return ""; } else { return Objects.stringValue(value); } }
/** * Evaluates the given object as a long integer. * * @param value * an object to interpret as a long integer * @return the long integer value implied by the given object * @throws NumberFormatException * if the given object can't be understood as a long integer */ public static long longValue(final Object value) throws NumberFormatException { if (value == null) { return 0L; } Class<?> c = value.getClass(); if (c.getSuperclass() == Number.class) { return ((Number)value).longValue(); } if (c == Boolean.class) { return (Boolean)value ? 1 : 0; } if (c == Character.class) { return (Character)value; } return Long.parseLong(stringValue(value, true)); }
/** * The formatting for {@link Locale#ENGLISH} might not be compatible with HTML (e.g. group * digits), thus use {@link Objects#stringValue(Object)} instead. * * @return value */ @Override protected String getModelValue() { N value = getModelObject(); if (value == null) { return ""; } else { return Objects.stringValue(value); } }
/** * Evaluates the given object as a long integer. * * @param value * an object to interpret as a long integer * @return the long integer value implied by the given object * @throws NumberFormatException * if the given object can't be understood as a long integer */ public static long longValue(Object value) throws NumberFormatException { if (value == null) { return 0L; } Class<?> c = value.getClass(); if (c.getSuperclass() == Number.class) { return ((Number)value).longValue(); } if (c == Boolean.class) { return ((Boolean)value).booleanValue() ? 1 : 0; } if (c == Character.class) { return ((Character)value).charValue(); } return Long.parseLong(stringValue(value, true)); }
String s = stringValue(value, true);
String s = stringValue(value, true);
return new BigInteger(stringValue(value, true));
return new BigDecimal(stringValue(value, true));
return new BigDecimal(stringValue(value, true));
return new BigDecimal(stringValue(value, true));
return new BigInteger(stringValue(value, true));
return new BigInteger(stringValue(value, true));
if (min != null) attributes.put("min", Objects.stringValue(min)); if (max != null) attributes.put("max", Objects.stringValue(max)); attributes.put("step", Objects.stringValue(_step));
if (min != null) attributes.put("min", Objects.stringValue(min)); if (max != null) attributes.put("max", Objects.stringValue(max)); attributes.put("step", Objects.stringValue(_step));
result = stringValue(value);