| Package | Description |
|---|---|
| de.alpharogroup.evaluate.object.checkers |
This package provides utility classes for check and evaluate java objects
|
| de.alpharogroup.evaluate.object.enums |
This package provides enum classes that defines contract violations
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Optional<ContractViolation> |
ToStringCheck.consistency(T object)
Checks consistency of method
Object.toString() for the given objects This method calls the same name method with default iterations of 7 |
static <T> Optional<ContractViolation> |
HashcodeCheck.consistency(T object)
Checks 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. |
static <T> Optional<ContractViolation> |
ToStringCheck.consistency(T object,
int iterations)
Checks consistency of method
Object.toString() for the given objects |
static <T> Optional<ContractViolation> |
EqualsCheck.consistency(T object,
T anotherObject)
Checks 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> Optional<ContractViolation> |
EqualsCheck.consistency(T object,
T anotherObject,
int iterations)
Checks 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> Optional<ContractViolation> |
HashcodeCheck.equality(T object,
T anotherObject)
Checks 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:
If two objects are equal according to the equals(Object) method, then calling the
hashCode method on each of the two objects must produce the same integer result. |
static <T> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsAndHashcode(T first,
T second,
T third,
T fourth)
Checks all the contract conditions for the methods
Object.equals(Object) and
Object.hashCode(). |
static <T> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsAndHashcodeEquality(T object,
T otherObject)
Checks 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> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsAndHashcodeUnequality(T object,
T otherObject)
Checks 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> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsHashcodeAndToString(Class<T> cls)
Checks all the contract conditions for the methods
Object.equals(Object),
Object.hashCode() and Object.toString() from the given Class. |
static <T> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsHashcodeAndToString(Class<T> cls,
Function<Class<T>,T> function)
Checks all the contract conditions for the methods
Object.equals(Object),
Object.hashCode() and Object.toString() from the given Class. |
static <T> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsHashcodeAndToString(T object)
Checks 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> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsHashcodeAndToString(T first,
T second,
T third,
T fourth)
Checks the all the contract conditions for the methods
Object.equals(Object),
Object.hashCode() and Object.toString(). |
static <T> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.equalsHashcodeEqualityAndToString(T object,
T otherObject,
T anotherObject)
Deprecated.
use instead the
ToStringCheck.consistency method in combination with
the HashcodeCheck.consistency, the
HashcodeCheck.equality method and the
EqualsCheck.reflexivityNonNullSymmetricConsistencyAndTransitivity
method. Note: will be removed in the next minor version |
static Optional<ContractViolation> |
ToStringCheck.evaluate(Class<?> clazz)
Checks if the given class implements the toString method.
|
static <T> Optional<ContractViolation> |
ToStringCheck.evaluateAndConsistency(T object)
Checks the all the contract conditions for the methods
Object.toString() |
static <T> Optional<ContractViolation> |
EqualsHashCodeAndToStringCheck.hashcodeCheck(T first,
T second,
T fourth)
Checks all the contract conditions for the method
Object.hashCode() |
static <T> Optional<ContractViolation> |
EqualsCheck.nonNull(T object)
Checks 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> Optional<ContractViolation> |
EqualsCheck.reflexivity(T object)
Checks 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> Optional<ContractViolation> |
EqualsCheck.reflexivityAndNonNull(T object)
Checks 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> Optional<ContractViolation> |
EqualsCheck.reflexivityNonNullSymmetricAndConsistency(T object,
T otherObject)
Checks 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> Optional<ContractViolation> |
EqualsCheck.reflexivityNonNullSymmetricConsistencyAndTransitivity(T object,
T otherObject,
T anotherObject)
Checks 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> Optional<ContractViolation> |
EqualsCheck.symmetric(T object,
T anotherObject)
Checks 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> Optional<ContractViolation> |
EqualsCheck.symmetricAndConsistency(T object,
T anotherObject)
Checks 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> Optional<ContractViolation> |
EqualsCheck.transitivity(T a,
T b,
T c)
Checks 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. |
static <T> Optional<ContractViolation> |
HashcodeCheck.unequality(T object,
T anotherObject)
Checks unequality of hash code from the given objects that should be unequal, that means
according to
Object.hashCode() that this method should evaluate the following
contract condition:
It is not required that if two objects are unequal according to the
Object.equals(java.lang.Object) method, then calling the hashCode
method on each of the two objects must produce distinct integer results. |
| Modifier and Type | Class and Description |
|---|---|
class |
EqualsContractViolation
The enum
EqualsContractViolation represents a contract violation as the name let presume |
class |
EqualsHashcodeContractViolation
The enum
EqualsHashcodeContractViolation represents a contract violation as the name let
presume |
class |
HashcodeContractViolation
The enum
HashcodeContractViolation represents a contract violation as the name let
presume |
class |
ToStringContractViolation
The enum
ToStringContractViolation represents a contract violation as the name let
presume |
Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.