Package org.apache.juneau.assertions
Class AssertionPredicate<T>
java.lang.Object
org.apache.juneau.assertions.AssertionPredicate<T>
- Type Parameters:
T- the type of input being tested.
- All Implemented Interfaces:
Predicate<T>
- Direct Known Subclasses:
AssertionPredicate.And,AssertionPredicate.Not,AssertionPredicate.Or
Wrapper around a
Predicate that allows for an error message for when the predicate fails.
Typically used wherever predicates are allowed for testing of Assertion objects such as...
FluentObjectAssertion.is(Predicate)FluentArrayAssertion.is(Predicate...)FluentPrimitiveArrayAssertion.is(Predicate...)FluentListAssertion.isEach(Predicate...)
See AssertionPredicates for a set of predefined predicates for common use cases.
Example:
See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEncapsulates multiple predicates into a single AND operation.static classNegates an assertion.static classEncapsulates multiple predicates into a single OR operation. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAssertionPredicate(Predicate<T> inner, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the error message from the last call to this assertion.boolean
-
Field Details
-
VALUE
Argument placeholder for tested value.
-
-
Constructor Details
-
AssertionPredicate
Constructor.- Parameters:
inner- The predicate test.message- The error message if predicate fails.
SupportsMessageFormat-style arguments.args- Optional message arguments.
Can containVALUEto specify the value itself as an argument.
Can containfunctionsto apply to the tested value.
-
-
Method Details