public class DeepEquals extends Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
DeepEquals.DualKey |
| Modifier and Type | Field and Description |
|---|---|
private static Map<Class,Boolean> |
_customEquals |
private static Map<Class,Boolean> |
_customHash |
private static Map<Class,Collection<Field>> |
_reflectedFields |
| Constructor and Description |
|---|
DeepEquals() |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
compareOrdered(DeepEquals.DualKey dualKey,
LinkedList<DeepEquals.DualKey> stack,
Collection visited)
Compare two Collections that must be same length and in same order.
|
private static boolean |
compareUnordered(Collection col1,
Collection col2,
Set visited)
Deeply compare the two sets referenced by dualKey.
|
static boolean |
deepEquals(Object a,
Object b) |
private static boolean |
deepEquals(Object a,
Object b,
Set<DeepEquals.DualKey> visited) |
static int |
deepHashCode(Object obj) |
static Collection<Field> |
getDeepDeclaredFields(Class c) |
static boolean |
hasCustomEquals(Class c) |
static boolean |
hasCustomHashCode(Class c) |
private static final Map<Class,Collection<Field>> _reflectedFields
private static boolean deepEquals(Object a, Object b, Set<DeepEquals.DualKey> visited)
private static boolean compareOrdered(DeepEquals.DualKey dualKey, LinkedList<DeepEquals.DualKey> stack, Collection visited)
dualKey - DualKey represents the two Collections to comparevisited - Collection of objects already compared (prevents cycles)stack - add items to compare to the Stack (Stack versus recursion)private static boolean compareUnordered(Collection col1, Collection col2, Set visited)
col1 - Collection onecol2 - Collection twovisited - Set containing items that have already been compared, so as to
prevent cycles.public static boolean hasCustomEquals(Class c)
public static int deepHashCode(Object obj)
public static boolean hasCustomHashCode(Class c)
public static Collection<Field> getDeepDeclaredFields(Class c)
c - Class instanceCopyright © 2015. All Rights Reserved.