Package de.gebit.integrity.comparator
Class SimpleComparisonResult
java.lang.Object
de.gebit.integrity.comparator.SimpleComparisonResult
- All Implemented Interfaces:
ComparisonResult
- Direct Known Subclasses:
MapComparisonResult
The most basic comparison result. This is just a boolean yes/no, without any additional information.
- Author:
- Rene Schneider - initial API and implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleComparisonResultThe result value for "equality".static final SimpleComparisonResultThe result value for "inequality". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanWhether this result documents a successful comparison.static SimpleComparisonResultvalueOf(boolean aValue) Returns the matchingSimpleComparisonResultfor a given boolean value.
-
Field Details
-
EQUAL
The result value for "equality". Can be used to prevent allocation of new objects. -
NOT_EQUAL
The result value for "inequality". Can be used to prevent allocation of new objects.
-
-
Constructor Details
-
SimpleComparisonResult
public SimpleComparisonResult(boolean anEqualityFlag) Creates a new instance.- Parameters:
anEqualityFlag- whether the result should represent equality or inequality
-
-
Method Details
-
valueOf
Returns the matchingSimpleComparisonResultfor a given boolean value.- Parameters:
aValue- the value- Returns:
- the
SimpleComparisonResult
-
isSuccessful
public boolean isSuccessful()Description copied from interface:ComparisonResultWhether this result documents a successful comparison. Most of the time, this boils down to whether the result equals the expected value, but custom comparator fixtures may override this.- Specified by:
isSuccessfulin interfaceComparisonResult- Returns:
-
equals
-
hashCode
public int hashCode()
-