public final class EqualityTester extends Object
Object.equals(Object) and Object.hashCode()
.| Modifier and Type | Class and Description |
|---|---|
static interface |
EqualityTester.Exerciser<T>
Exerciser used when testing consistent property in equals method.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
testEqualsAndHashCode(T obj,
T equal1,
T equal2,
EqualityTester.Exerciser<T> exerciser,
T... unequals)
Tests
Object.equals(Object) and Object.hashCode() methods using the given
exerciser to test consistency. |
static <T> void |
testEqualsAndHashCode(T obj,
T equal1,
T equal2,
T... unequals)
Tests
Object.equals(Object) and Object.hashCode() methods partially testing
consistency property: Fields that are not part of the Object.equals(Object) are not
modified - no EqualityTester.Exerciser is used. |
@SafeVarargs public static <T> void testEqualsAndHashCode(T obj, T equal1, T equal2, T... unequals)
Object.equals(Object) and Object.hashCode() methods partially testing
consistency property: Fields that are not part of the Object.equals(Object) are not
modified - no EqualityTester.Exerciser is used.T - type of the object to testobj - base objectequal1 - an object expected to be equal to the baseequal2 - an object expected to be equal to the baseunequals - a set of objects expected not to be equal to the base@SafeVarargs public static <T> void testEqualsAndHashCode(T obj, T equal1, T equal2, EqualityTester.Exerciser<T> exerciser, T... unequals)
Object.equals(Object) and Object.hashCode() methods using the given
exerciser to test consistency.T - type of the object to testobj - base objectequal1 - an object expected to be equal to the baseequal2 - an object expected to be equal to the baseexerciser - exerciser used to test consistencyunequals - a set of objects expected not to be equal to the baseCopyright © 2015. All rights reserved.