public final 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)
Evaluates the contract condition for 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)
Evaluates the contract condition for 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 |
evaluateNonNull(T object)
Evaluates the contract condition for 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 <T> boolean |
evaluateReflexivity(T object)
Evaluates the contract condition for 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 <T> boolean |
evaluateReflexivityAndNonNull(T object)
Evaluates the contract conditions for reflexivity and non null, 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 <T> boolean |
evaluateReflexivityNonNullSymmetricAndConsistency(T object,
T otherObject)
Evaluates the contract conditions for reflexivity, non null, symmetric and consistency of the
given objects, 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 <T> boolean |
evaluateReflexivityNonNullSymmetricConsistencyAndTransitivity(T object,
T otherObject,
T anotherObject)
Evaluates the contract conditions for reflexivity, non null, symmetric, consistency and
transitivity of the given objects, 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 <T> boolean |
evaluateSymmetric(T object,
T anotherObject)
Evaluates the contract condition for 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 <T> boolean |
evaluateSymmetricAndConsistency(T object,
T anotherObject)
Evaluates the contract conditions for symmetric and consistency 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 <T> boolean |
evaluateTransitivity(T a,
T b,
T c)
Evaluates the contract condition for 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 <T> boolean evaluateReflexivity(T object)
Object.equals(Object) that this method should evaluate the following contract
condition:
x, x.equals(x)
should return true.
Object.equals(Object)T - the generic typeobject - the objectpublic static <T> boolean evaluateSymmetric(T object,
T 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)T - the generic typeobject - the objectanotherObject - the another objectpublic static <T> boolean evaluateTransitivity(T a,
T b,
T 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)T - the generic typea - the objectb - other objectc - another objectpublic static <T> boolean evaluateNonNull(T object)
Object.equals(Object) that this method should evaluate the
following contract condition:
x, x.equals(null) should return
false.
Object.equals(Object) T - the generic typeobject - 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.public static <T> boolean evaluateReflexivityAndNonNull(T object)
Object.equals(Object) that this method should evaluate the following contract
condition:
x, x.equals(x)
should return true.
x, x.equals(null) should return
false.
Object.equals(Object)T - the generic typeobject - the objectpublic static <T> boolean evaluateSymmetricAndConsistency(T object,
T 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.
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 evaluateReflexivityNonNullSymmetricAndConsistency(T object,
T otherObject)
Object.equals(Object) that this method should
evaluate the following contract condition:
x, x.equals(x)
should return true.
x, x.equals(null) should return
false.
x and y,
x.equals(y) should return true if and only if y.equals(x) returns
true.
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 objectotherObject - the other objectpublic static <T> boolean evaluateReflexivityNonNullSymmetricConsistencyAndTransitivity(T object,
T otherObject,
T anotherObject)
Object.equals(Object) that
this method should evaluate the following contract condition:
x, x.equals(x)
should return true.
x, x.equals(null) should return
false.
x and y,
x.equals(y) should return true if and only if y.equals(x) returns
true.
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.
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)T - the generic typeobject - the objectotherObject - the other objectanotherObject - the another objectCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.