public class ObjectUtils extends Object
Operations on Object
.
This class tries to handle null
input gracefully.
An exception will generally not be thrown for a null
input.
Each method documents its behaviour in more detail.
Constructor and Description |
---|
ObjectUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
identityToString(StringBuffer buffer,
Object object)
Appends the toString that would be produced by
Object
if a class did not override toString itself. |
public static void identityToString(StringBuffer buffer, Object object)
Appends the toString that would be produced by Object
if a class did not override toString itself. null
will throw a NullPointerException for either of the two parameters.
ObjectUtils.identityToString(buf, "") = buf.append("java.lang.String@1e23" ObjectUtils.identityToString(buf, Boolean.TRUE) = buf.append("java.lang.Boolean@7fa" ObjectUtils.identityToString(buf, Boolean.TRUE) = buf.append("java.lang.Boolean@7fa")
buffer
- the buffer to append toobject
- the object to create a toString for