Package net.reevik.shade.validators
Class ValidatorFactory
java.lang.Object
net.reevik.shade.validators.ValidatorFactory
Standard validator factory is a factory implementation for
ResultValidator
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ResultValidator
<T> The validator assures that the results from both endpoints equal.static <T> ResultValidator
<T> mustPerformSimilar
(Duration maxDeviance) The validator assures that both endpoint calls perform similar, i.e., within the range of max.static ValidationResult
Factory method forValidationResult
.
-
Constructor Details
-
ValidatorFactory
public ValidatorFactory()
-
-
Method Details
-
mustEqual
The validator assures that the results from both endpoints equal.- Type Parameters:
T
- Generic type of the result object.- Returns:
ResultValidator
instance.
-
mustPerformSimilar
The validator assures that both endpoint calls perform similar, i.e., within the range of max. deviance inDuration
.- Type Parameters:
T
- Generic type of the result object.- Parameters:
maxDeviance
- Max. deviance inDuration
.- Returns:
ResultValidator
instance.
-
newResult
Factory method forValidationResult
.- Parameters:
passed
- Whether the validation succeeded.errorDescription
- If the validation fails, error description is required.- Returns:
ValidationResult
instance.
-