Java Utililty Methods Object Value Of

List of utility methods to do Object Value Of

Description

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

Method

StringvalueOf(final Object o)
value Of
return (o instanceof String) ? (String) o : (o == null ? "null" : o.toString());
StringvalueOf(Object o)
This works the same as String#valueOf(Object) , except it returns an empty string instead of "null" if the input is null.
return o == null ? "" : String.valueOf(o);
StringvalueOf(Object o)
value Of
if (o == null)
    return "null";
if (o instanceof byte[])
    return "size=" + ((byte[]) o).length;
if (o instanceof Byte[])
    return "size=" + ((Byte[]) o).length;
if (o instanceof Object[])
    return "size=" + ((Object[]) o).length + ", values=[" + mkString((Object[]) o, 120) + "]";
...
StringvalueOf(Object o)
value Of
if (o == null) {
    return "";
if (o instanceof byte[]) {
    return new String((byte[]) o);
if (o instanceof char[]) {
    return new String((char[]) o);
...
StringvalueOf(Object obj)
value Of
return obj == null ? null : String.valueOf(obj);
StringvalueOf(Object obj)
Returns the string value of the object.
return String.valueOf(obj);
StringvalueOf(Object obj)
transform a Obejct 2 a String ,return value is "" when object is null
return (obj == null) ? "" : obj.toString();
StringvalueOf(Object object)
The String value of an Object

This method calls String#valueOf(Object) unless the object is null, in which case null is returned

return object == null ? null : String.valueOf(object);
StringvalueOf(Object value)
 1. 
if (value == null) {
    return null;
if (value instanceof String) {
    return (String) value;
return value.toString();
StringvalueOf(Object[] array)
Converts an objects to a string.
return toString(array, "null");