public class ObjectUtils extends Object
| Constructor and Description |
|---|
ObjectUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Equatable> |
equal(T reference,
Object other) |
static <T extends Comparable<? super T>> |
equalByComparison(T reference,
Object object)
Return true if
reference and object are not null, the exact same runtime type, and reference.compareTo(object) == 0 |
static boolean |
equalByToString(Object reference,
Object other)
This method returns
true if the toString() methods on both objects return matching strings AND both objects are the exact same runtime type. |
static boolean |
equalsByToString(Object reference,
Object other)
Deprecated.
Use equalByToString() instead
|
static boolean |
notEqual(Object reference,
Object other)
Return true if
reference is definitely not equal to other. |
public ObjectUtils()
public static boolean equalByToString(Object reference, Object other)
This method returns true if the toString() methods on both objects return matching strings AND both objects are the exact same runtime type.
Returns true immediately if reference == other (ie they are the same object).
Returns false immediately if other==null or is a different runtime type than reference.
If neither one is null, and both are the exact same runtime type, then compare the toString() methods
reference - The object other is being compared to.other - The object being examined for equality with reference.NullPointerException - If reference is null or reference.toString() returns nullpublic static <T extends Comparable<? super T>> boolean equalByComparison(T reference, Object object)
reference and object are not null, the exact same runtime type, and reference.compareTo(object) == 0NullPointerException - If reference is nullpublic static boolean notEqual(Object reference, Object other)
Return true if reference is definitely not equal to other.
If other is null OR a different runtime type than reference, return true
reference - The object other is being compared to.other - The object being examined for equality with reference.NullPointerException - If reference is null@Deprecated public static boolean equalsByToString(Object reference, Object other)
Copyright © 2010–2014 The Kuali Foundation. All rights reserved.