public final class EqualsUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
bothNotNull(Object a,
Object b) |
static boolean |
bothNull(Object a,
Object b) |
static boolean |
bothNullOrNot(Object a,
Object b)
Check if both objects are either null or not null.
|
static boolean |
eq(Object a,
Object b)
Deprecated.
|
static boolean |
eqClasses(Object a,
Object b)
|
static boolean |
eqListSorted(List<?> as,
List<?> bs)
Deprecated.
|
static boolean |
eqListUnsorted(List<?> as,
List<?> bs)
Compare the (distinct) elements of two lists for equality treating the lists as sets.
|
static boolean |
eqMap(Map<?,?> as,
Map<?,?> bs)
Deprecated.
|
static boolean |
eqObj(Object a,
Object b)
Deprecated.
|
static int |
hash(Object... as)
Deprecated.
|
static boolean |
ne(Object a,
Object b)
Check if
a and b are not equal. |
@Deprecated public static boolean eqObj(Object a, Object b)
a and b are equal. Each of them may be null.@Deprecated public static boolean eq(Object a, Object b)
a and b are equal. Each of them may be null.public static boolean ne(Object a, Object b)
a and b are not equal. Each of them may be null.public static boolean eqListUnsorted(List<?> as, List<?> bs)
Sets by definition do not allow multiplicity of elements; a set is a (possibly empty) collection of distinct elements. As Lists may contain non-unique entries, this method removes duplicates before continuing with the comparison check. Examples of 1. equality: {1, 2} = {2, 1} = {1, 1, 2} = {1, 2, 2, 1, 2}, null = null 2. unequal: {1, 2, 2} != {1, 2, 3}, null != {}
public static boolean eqListSorted(List<?> as, List<?> bs)
eqObj(Object, Object) or List.equals(Object)public static boolean eqMap(Map<?,?> as, Map<?,?> bs)
eqObj(Object, Object) or Map.equals(Object)public static boolean bothNullOrNot(Object a, Object b)
@Deprecated public static int hash(Object... as)
Copyright © 2009–2020 Opencast Project. All rights reserved.