Example usage for Java org.apache.commons.lang ObjectUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
Null | NULL Singleton used as a For example, in a |
int | compare(T c1, T c2) Null safe comparison of Comparables. |
int | compare(T c1, T c2, boolean nullGreater) Null safe comparison of Comparables. |
T | defaultIfNull(T object, T defaultValue) Returns a default value if the object passed is ObjectUtils.defaultIfNull(null, null) = null ObjectUtils.defaultIfNull(null, "") = "" ObjectUtils.defaultIfNull(null, "zz") = "zz" ObjectUtils.defaultIfNull("abc", *) = "abc" ObjectUtils.defaultIfNull(Boolean.TRUE, *) = Boolean.TRUE |
boolean | equals(Object object1, Object object2) Compares two objects for equality, where either one or both objects may be ObjectUtils.equals(null, null) = true ObjectUtils.equals(null, "") = false ObjectUtils.equals("", null) = false ObjectUtils.equals("", "") = true ObjectUtils.equals(Boolean.TRUE, null) = false ObjectUtils.equals(Boolean.TRUE, "true") = false ObjectUtils.equals(Boolean.TRUE, Boolean.TRUE) = true ObjectUtils.equals(Boolean.TRUE, Boolean.FALSE) = false |
int | hashCode(Object obj) Gets the hash code of an object returning zero when the object is ObjectUtils.hashCode(null) = 0 ObjectUtils.hashCode(obj) = obj.hashCode() |
String | identityToString(Object object) Gets the toString that would be produced by |
void | identityToString(StringBuffer buffer, Object object) Appends the toString that would be produced by |
boolean | notEqual(Object object1, Object object2) Compares two objects for inequality, where either one or both objects may be ObjectUtils.notEqual(null, null) = false ObjectUtils.notEqual(null, "") = true ObjectUtils.notEqual("", null) = true ObjectUtils.notEqual("", "") = false ObjectUtils.notEqual(Boolean.TRUE, null) = true ObjectUtils.notEqual(Boolean.TRUE, "true") = true ObjectUtils.notEqual(Boolean.TRUE, Boolean.TRUE) = false ObjectUtils.notEqual(Boolean.TRUE, Boolean.FALSE) = true |
String | toString(Object obj) Gets the ObjectUtils.toString(null) = "" ObjectUtils.toString("") = "" ObjectUtils.toString("bat") = "bat" ObjectUtils.toString(Boolean.TRUE) = "true" |
String | toString(Object obj, String nullStr) Gets the ObjectUtils.toString(null, null) = null ObjectUtils.toString(null, "null") = "null" ObjectUtils.toString("", "null") = "" ObjectUtils.toString("bat", "null") = "bat" ObjectUtils.toString(Boolean.TRUE, "null") = "true" |
String | toString() Returns a string representation of the object. |