@Immutable public final class EqualsHelper extends Object
equals method generation| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(boolean aObj1,
boolean aObj2)
Check if two values are equal.
|
static boolean |
equals(byte aObj1,
byte aObj2)
Check if two values are equal.
|
static boolean |
equals(char aObj1,
char aObj2)
Check if two values are equal.
|
static boolean |
equals(double aObj1,
double aObj2)
Check if two double values are equal.
|
static boolean |
equals(float aObj1,
float aObj2)
Check if two float values are equal.
|
static boolean |
equals(int aObj1,
int aObj2)
Check if two values are equal.
|
static boolean |
equals(long aObj1,
long aObj2)
Check if two values are equal.
|
static boolean |
equals(Object aObj1,
Object aObj2)
Check if two values are equal.
|
static boolean |
equals(short aObj1,
short aObj2)
Check if two values are equal.
|
static boolean |
equalsAsList(Object aObj1,
Object aObj2)
This is a sanity method that first calls
CollectionHelper.getAsList(Object) on both objects an than calls
equalsCollection(Object, Object) on the collections. |
static boolean |
equalsCollection(Object aObj1,
Object aObj2)
Check if the content of the passed containers is equal.
|
static boolean |
equalsIgnoreCase(String sObj1,
String sObj2)
Check if the passed strings are equals case insensitive handling
null appropriately. |
static <K,V> boolean |
equalsMap(Map<K,V> aCont1,
Map<?,?> aCont2) |
static boolean |
equalsSet(Set<?> aCont1,
Set<?> aCont2) |
static <T> boolean |
identityEqual(T aObj1,
T aObj2)
The only place where objects are compared by identity.
|
public static <T> boolean identityEqual(@Nullable T aObj1, @Nullable T aObj2)
T - Type to check.aObj1 - First object. May be null.aObj2 - Second object. May be null.true if both objects are null or
reference the same object.public static boolean equals(boolean aObj1,
boolean aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.public static boolean equals(byte aObj1,
byte aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.public static boolean equals(char aObj1,
char aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.public static boolean equals(double aObj1,
double aObj2)
aObj1 - First doubleaObj2 - Second doubletrue if they are equal, false otherwise.public static boolean equals(float aObj1,
float aObj2)
aObj1 - First floataObj2 - Second floattrue if they are equal, false otherwise.public static boolean equals(int aObj1,
int aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.public static boolean equals(long aObj1,
long aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.public static boolean equals(short aObj1,
short aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.public static boolean equals(@Nullable Object aObj1, @Nullable Object aObj2)
aObj1 - First valueaObj2 - Second valuetrue if they are equal, false otherwise.EqualsImplementationRegistry.areEqual(Object, Object)public static boolean equalsIgnoreCase(@Nullable String sObj1, @Nullable String sObj2)
null appropriately.sObj1 - First object to comparesObj2 - Second object to comparetrue if they are equal case insensitive,
false otherwise.public static boolean equalsCollection(@Nullable Object aObj1, @Nullable Object aObj2)
EqualsImplementationRegistry.areEqual(Object, Object) method is
invoked to test for equality!aObj1 - The first containeraObj2 - The second containertrue if both objects are the same, or if they have the
same meta type and have the same content.IllegalArgumentException - if one of the arguments is not a container!public static boolean equalsAsList(@Nullable Object aObj1, @Nullable Object aObj2)
CollectionHelper.getAsList(Object) on both objects an than calls
equalsCollection(Object, Object) on the collections. This means
that calling this method with the String array ["a", "b"] and the
List<String> ("a", "b") will result in a return value of true.aObj1 - The first object to be comparedaObj2 - The second object to be comparedtrue if the contents are equal, false
otherwiseCopyright © 2014–2017 Philip Helger. All rights reserved.