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
Modifier and TypeClassDescriptionstatic class
Encapsulates multiple predicates into a single AND operation.static class
Negates an assertion.static class
Encapsulates multiple predicates into a single OR operation. -
Field Summary
-
Constructor Summary
ConstructorDescriptionAssertionPredicate
(Predicate<T> inner, String message, Object... args) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns 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 containVALUE
to specify the value itself as an argument.
Can containfunctions
to apply to the tested value.
-
-
Method Details