public class DeepEquals extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_STRINGS_TO_MATCH_NUMBERS |
static String |
IGNORE_CUSTOM_EQUALS |
Modifier and Type | Method and Description |
---|---|
static boolean |
deepEquals(Object a,
Object b)
Compare two objects with a 'deep' comparison.
|
static boolean |
deepEquals(Object a,
Object b,
Map<String,?> options)
Compare two objects with a 'deep' comparison.
|
static int |
deepHashCode(Object obj)
Get a deterministic hashCode (int) value for an Object, regardless of
when it was created or where it was loaded into memory.
|
static boolean |
hasCustomEquals(Class<?> c)
Determine if the passed in class has a non-Object.equals() method.
|
static boolean |
hasCustomHashCode(Class<?> c)
Determine if the passed in class has a non-Object.hashCode() method.
|
static boolean |
isContainerType(Object o) |
public static final String IGNORE_CUSTOM_EQUALS
public static final String ALLOW_STRINGS_TO_MATCH_NUMBERS
public static boolean deepEquals(Object a, Object b)
a
- Object one to compareb
- Object two to comparepublic static boolean deepEquals(Object a, Object b, Map<String,?> options)
a
- Object one to compareb
- Object two to compareoptions
- Map options for compare. With no option, if a custom equals()
method is present, it will be used. If IGNORE_CUSTOM_EQUALS is
present, it will be expected to be a Set of classes to ignore.
It is a black-list of classes that will not be compared
using .equals() even if the classes have a custom .equals() method
present. If it is and empty set, then no custom .equals() methods
will be called.public static boolean isContainerType(Object o)
public static boolean hasCustomEquals(Class<?> c)
c
- Class to check.public static int deepHashCode(Object obj)
obj
- Object who hashCode is desired.public static boolean hasCustomHashCode(Class<?> c)
c
- Class to check.Copyright © 2023. All rights reserved.