L - Type of the final DSL class / interface re-using / implementing this interface.D - Type of the data object to be checked with the resulting complex check.public interface CheckDsl<L,D> extends Check<D>
| Modifier and Type | Method and Description |
|---|---|
L |
or()
Allow chaining of checks using logical or.
|
L |
with(Check<? super D> check)
Add check of the root object to the
|
<V> TransformationBuilder<V,L> |
withField(String name,
Transformation<? super D,V> transformation)
Add a check of a transformed value, e.g. field access.
|
<V> TransformationBuilder<V,L> |
withField(Transformation<? super D,V> transformation)
Add a check of a transformed value, e.g. field access.
|
L with(Check<? super D> check)
check - Additional check to add to the general logical and.<V> TransformationBuilder<V,L> withField(String name, Transformation<? super D,V> transformation)
V - Type of the transformed value.name - Name of the transformation / fieldtransformation - Transformation function to apply in order to check the result.<V> TransformationBuilder<V,L> withField(Transformation<? super D,V> transformation)
V - Type of the transformed value.transformation - Transformation function to apply in order to check the result.L or()
check.withField(MyClass::getFirstName).equalTo("John").withField(MyClass::getLastName).equalTo("Doe")
.or()
.withField(MyClass::getFirstName).equalTo("Jane").withField(MyClass::getLastName).equalTo("Dee")
evaluates as:
(firstName == "John" and lastName == "Doe") or (firstName == "Jane" and lastName == "Dee")Copyright © 2021. All rights reserved.