Java Utililty Methods Number Value Of

List of utility methods to do Number Value Of

Description

The list of methods to do Number Value Of are organized into topic(s).

Method

intvalueOf(Boolean b)
value Of
return b == null || !b ? FALSE : TRUE;
StringvalueOf(boolean b)
value Of
return String.valueOf(b);
BooleanvalueOf(boolean b)
value Of
return (b ? Boolean.TRUE : Boolean.FALSE);
booleanvalueOf(Boolean bool)
value Of
if (bool == null) {
    return false;
} else {
    return bool;
StringvalueOf(boolean flag)
value Of
return flag ? "true" : "false";
StringvalueOf(boolean tmp)
Description of the Method
if (tmp) {
    return "true";
} else {
    return "false";
StringvalueOf(Boolean value)
Returns the string value of the given boolean.
return value != null ? String.valueOf(value) : null;
booleanvalueOf(Boolean value)
value Of
if (value == null)
    return false;
return value.booleanValue();
CharactervalueOf(char c)
This is a performance optimization.
return c <= 127 ? charCache[(int) c] : c;
bytevalueOf(char hexChar)
Returns the hex value of the given character
hexChar = Character.toLowerCase(hexChar);
for (byte i = 0; i < HEX_CHAR_TABLE.length; i++) {
    if (hexChar == HEX_CHAR_TABLE[i]) {
        return i;
throw new IllegalArgumentException(hexChar + " is not a hex char");