public class EqualsEvaluator extends Object
EqualsEvaluator provides algorithms for evaluate the equals
contract of an given object.| Constructor and Description |
|---|
EqualsEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
evaluateConsistency(T object,
T anotherObject)
Evaluate consistency of the given objects, that means according to
Object.equals(Object) that this method should evaluate the following contract
condition:
It is consistent: for any non-null reference values x and y,
multiple invocations of x.equals(y) consistently return true or consistently
return false, provided no information used in equals comparisons on the
objects is modified. |
static <T> boolean |
evaluateConsistency(T object,
T anotherObject,
int iterations)
Evaluate consistency of the given objects, that means according to
Object.equals(Object) that this method should evaluate the following contract
condition:
It is consistent: for any non-null reference values x and y,
multiple invocations of x.equals(y) consistently return true or consistently
return false, provided no information used in equals comparisons on the
objects is modified. |
static boolean |
evaluateNonNull(Object object)
Evaluate non-null condition is given of the given object, that means according to
Object.equals(Object) that this method should evaluate the following contract
condition:
For any non-null reference value x, x.equals(null) should return
false. |
static boolean |
evaluateReflexivity(Object object)
Evaluate reflexivity of the given object, that means according to
Object.equals(Object) that this method should evaluate the following contract
condition:
It is reflexive: for any non-null reference value x, x.equals(x)
should return true. |
static boolean |
evaluateSymmetric(Object object,
Object anotherObject)
Evaluate symmetric of the given objects, that means according to
Object.equals(Object) that this method should evaluate the following contract
condition:
It is symmetric: for any non-null reference values x and y,
x.equals(y) should return true if and only if y.equals(x) returns
true. |
static boolean |
evaluateTransitivity(Object a,
Object b,
Object c)
Evaluate transitivity of the given objects, that means according to
Object.equals(Object) that this method should evaluate the following contract
condition:
It is transitive: for any non-null reference values x, y, and
z, if x.equals(y) returns true and y.equals(z) returns
true, then x.equals(z) should return true. |
public static boolean evaluateReflexivity(Object object)
Object.equals(Object) that this method should evaluate the following contract
condition:
x, x.equals(x)
should return true.
Object.equals(Object)object - the objectpublic static boolean evaluateSymmetric(Object object, Object anotherObject)
Object.equals(Object) that this method should evaluate the following contract
condition:
x and y,
x.equals(y) should return true if and only if y.equals(x) returns
true.
Object.equals(Object)object - the objectanotherObject - the another objectpublic static boolean evaluateTransitivity(Object a, Object b, Object c)
Object.equals(Object) that this method should evaluate the following contract
condition:
x, y, and
z, if x.equals(y) returns true and y.equals(z) returns
true, then x.equals(z) should return true.
Object.equals(Object)a - the objectb - other objectc - another objectpublic static boolean evaluateNonNull(Object object)
Object.equals(Object) that this method should evaluate the following contract
condition:
x, x.equals(null) should return
false.
Object.equals(Object)object - the objectpublic static <T> boolean evaluateConsistency(T object,
T anotherObject)
Object.equals(Object) that this method should evaluate the following contract
condition:
x and y,
multiple invocations of x.equals(y) consistently return true or consistently
return false, provided no information used in equals comparisons on the
objects is modified.
Object.equals(Object)T - the generic typeobject - the objectanotherObject - the another objectpublic static <T> boolean evaluateConsistency(T object,
T anotherObject,
int iterations)
Object.equals(Object) that this method should evaluate the following contract
condition:
x and y,
multiple invocations of x.equals(y) consistently return true or consistently
return false, provided no information used in equals comparisons on the
objects is modified.
Object.equals(Object)T - the generic typeobject - the objectanotherObject - the another objectiterations - the iterations of call of equals method.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.