public final class Equals extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allNull(Object... obs)
Tests if all given objects are
null. |
static boolean |
beanDeepEqual(Object o,
Object o2)
Compares the bean properties of given objects.
|
static boolean |
beanDeepEqual(Object o,
Object o2,
String... ignoreOps)
Tests if the given objects 'o' and 'o2' are of the same type and if all bean getters of 'o' return the same
values as the bean getters of 'o2'.
|
static boolean |
isBeanGetter(Method m)
Tests if a
Method is a bean getter operation. |
static boolean |
nonNull(Object... obs)
Test if non of the given objects is
null. |
static boolean |
nullEqual(Object o1,
Object o2)
Tests if both objects are equals whereas they are considered equal if they are both
null, too. |
static boolean |
xor(Object o1,
Object o2)
Tests if one of the objects is
null and the other is not null. |
public static boolean beanDeepEqual(Object o, Object o2)
beanDeepEqual(java.lang.Object, java.lang.Object, java.lang.String[]) with a null String[].o - object oneo2 - object twobeanDeepEqual(java.lang.Object, java.lang.Object, java.lang.String[])public static boolean beanDeepEqual(Object o, Object o2, String... ignoreOps)
null they're also considered equal
nullEqual(java.lang.Object, java.lang.Object). This is also true for all the bean getter return values
that are checked. There is also the possibility to provide an ignore list that can contain names of getter
operations that shall be ignored when checking for equality.o - object oneo2 - object twoignoreOps - all operation names, that shall be ignored during the equality check, may be
nullnullEqual(java.lang.Object, java.lang.Object),
isBeanGetter(java.lang.reflect.Method)public static boolean isBeanGetter(Method m)
Method is a bean getter operation. A bean getter operation has different properties:boolean getters)m - given methodtrue if all the requirements listed above are met, false otherwisepublic static boolean nullEqual(Object o1, Object o2)
null, too.o1 - object oneo2 - object twotrue if o1 == null and o2 == null or if o1.equals(o2), false otherwisepublic static boolean xor(Object o1, Object o2)
null and the other is not null.o1 - object oneo2 - object twotrue if object one is null and object two is not null and vice
versa, false if both objects are null or both objects are not
null.public static boolean allNull(Object... obs)
null. If no objects are provided at all, true is
returned, too.obs - the objectstrue if all given objects are null, false otherwisepublic static boolean nonNull(Object... obs)
null. If no objects are provided at all, false is
returned, too.obs - the objectstrue if all given objects are non-null, false otherwiseCopyright © 2012–2026 cismet GmbH. All rights reserved.