Package org.qaddict
Interface Expectation<D>
- Type Parameters:
D- Type of the data to be validated.
- All Superinterfaces:
Described
- All Known Implementing Classes:
AbstractExpectationBuilder,ConditionalPredicate,EveryElementExpectation,ExpectationBuilder,ExpectationDescription,InAnyOrderExpectation,InOrderOfDefinitionExpectation,Negation,OperatorExpectation,PredicateExpectation,SynchronizedPredicate,ThrowableExpectation,TransformedExpectation
Basic interface representing an expectation, applicable on validated data.
This is the main entry interface, used to implement the Composite design pattern for composing complex validations
by re-usable pieces.
-
Method Summary
Modifier and TypeMethodDescriptionEvaluate the expectation on provided data.default booleanShortcut method, which performs the method evaluate() and only returns its boolean result.Methods inherited from interface org.qaddict.Described
description
-
Method Details
-
evaluate
Evaluate the expectation on provided data. This method returns full detail of the evaluation. As various implementations can also compose partial expectations together, each of them may provide partial details, collected to full detail of description, what was happening during the validation.- Parameters:
data- Validated data.- Returns:
- EvaluationNode containing details of validation using this expectation in the subtree of this expectation.
-
test
Shortcut method, which performs the method evaluate() and only returns its boolean result. This allows simplified usage, when the full detail is not required. It also allows `Predicate` like simple use.- Parameters:
data- Validated data.- Returns:
- True if data satisfy the expectation, otherwise false.
-