public class EqualsHelper
extends java.lang.Object
Constructor and Description |
---|
EqualsHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Check if two objects are equal according to their equals
implementation.
|
static int |
hashCode(java.lang.Object o)
Get the hashcode for an object.
|
static <T> int |
hashCode(T... objects)
Hashcode calculation for an array of objects that doesn't
depend on the position in the array.
|
static <T> boolean |
invariantEquals(T[] a1,
T[] a2)
Checks if two arrays contains equal elements disregarding
their positions in the array.
|
public static boolean equals(java.lang.Object o1, java.lang.Object o2)
o1
- The first objecto2
- The second objectpublic static int hashCode(java.lang.Object o)
o
- The object to get the hash code for@SafeVarargs public static <T> int hashCode(T... objects)
objects
- An array of objectsinvariantEquals(Object[], Object[])
public static <T> boolean invariantEquals(T[] a1, T[] a2)
a1
- The first arraya2
- The second array