public class EqualsHashCodeAndToStringEvaluator extends Object
EqualsHashCodeAndToStringEvaluator is a combination of all evaluators.| Constructor and Description |
|---|
EqualsHashCodeAndToStringEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
evaluateEqualsAndHashcodeEquality(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 |
evaluateEqualsAndHashcodeUnequality(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 |
evaluateEqualsHashcodeAndToString(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 |
evaluateEqualsHashcodeEqualityAndToString(T object,
T otherObject,
T anotherObject)
Evaluate consistency of method
Object.toString() for the given objects Evaluate consistency of the given object, that means according to Object.hashCode()
that this method should evaluate the following contract condition:
Whenever it is invoked on the same object more than once during an execution of a Java
application, the hashCode method must consistently return the same integer, provided
no information used in equals comparisons on the object is modified. |
public static <T> boolean evaluateEqualsAndHashcodeEquality(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)
Evaluate equality of hash code from the given objects that should be equal(if not an
IllegalArgumentException will be thrown), that means according to
Object.hashCode() that this method should evaluate the following contract condition:
equals(Object) method, then calling the
hashCode method on each of the two objects must produce the same integer result.
T - the generic typeobject - the objectotherObject - the other objectpublic static <T> boolean evaluateEqualsAndHashcodeUnequality(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)
Evaluate unequality of hash code from the given objects that should be unequal(if not an
IllegalArgumentException will be thrown), that means according to
Object.hashCode() that this method should evaluate the following contract condition:
Object.equals(java.lang.Object) method, then calling the hashCode
method on each of the two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results for unequal objects may
improve the performance of hash tables.
T - the generic typeobject - the objectotherObject - the other objectpublic static <T> boolean evaluateEqualsHashcodeAndToString(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)
Evaluate consistency of the given object, that means according to Object.hashCode()
that this method should evaluate the following contract condition:
hashCode method must consistently return the same integer, provided
no information used in equals comparisons on the object is modified. This integer
need not remain consistent from one execution of an application to another execution of the
same application.
Object.hashCode()T - the generic typeobject - the objectObject.equals(Object) and the consistency contract condition of
Object.hashCode() is given otherwise falsepublic static <T> boolean evaluateEqualsHashcodeEqualityAndToString(T object,
T otherObject,
T anotherObject)
Object.toString() for the given objects Object.hashCode()
that this method should evaluate the following contract condition:
hashCode method must consistently return the same integer, provided
no information used in equals comparisons on the object is modified. This integer
need not remain consistent from one execution of an application to another execution of the
same application.
Object.hashCode()
Evaluate equality of hash code from the given objects that should be equal(if not an
IllegalArgumentException will be thrown), that means according to
Object.hashCode() that this method should evaluate the following contract condition:
equals(Object) method, then calling the
hashCode method on each of the two objects must produce the same integer result.
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 objectObject.toString() for the given objects and if
consistency contract condition of Object.hashCode() is given and if equality
of hash code from the given objects is given and if reflexivity, non null, symmetric,
consistency and transitivity contract conditions is given otherwise falseCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.