List of utility methods to do Number Value Of
T | valueOf(Class value Of for (T value : enumType.getEnumConstants()) { if (value.ordinal() == ordinal) { return value; return null; |
boolean | valueOf(final Boolean value) Returns false when the value is null. return value == null ? false : value.booleanValue();
|
Float | valueOf(float f) value Of return new Float(f); |
Integer | valueOf(int i) value Of if (i >= 0 && i < INTEGER.length) { return INTEGER[i]; } else { return new Integer(i); |
boolean | valueOf(int i) value Of return (i != 0);
|
boolean | valueOf(int number) Converts a primitive integer to boolean by assuming 0 is false and everything else (1) is true. return 0 == number ? false : true;
|
String | valueOf(int[] source) Utility method to take a int[] containing codepoints and return a string representation with code units. StringBuilder result = new StringBuilder(source.length); for (int i = 0; i < source.length; i++) { result.appendCodePoint(source[i]); return result.toString(); |
int | valueOf(Integer value) value Of if (value != null) { return value; return 0; |
Integer | valueOf(Integer value) value Of return value != null ? value : 0;
|
short | valueOf(Short value) value Of return valueOf(value, (short) 0); |