Class AssertionPredicates
AssertionPredicate objects.
 
 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...)
Example:
   
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic final <T> AssertionPredicate<T>Combines the specified predicates into a singled AND'ed predicate.static final <T> AssertionPredicate<T>any()Predicate that always returnstrue .static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string contains the specified substring.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value equals the specified value.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string matches the specified value.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string does not match the specified value ignoring case.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value is exactly specified type.static final <T> AssertionPredicate<T>isNull()Predicate that returnstrue if the tested value is null.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string matches the specified match pattern.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value does not match the specified value.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string does not match the specified value.static final <T> AssertionPredicate<T>Negates the specified predicate.static final <T> AssertionPredicate<T>notNull()Predicate that returnstrue if the tested value is not null.static final <T> AssertionPredicate<T>Combines the specified predicates into a singled OR'ed predicate.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string matches the specified regular expression.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string matches the specified regular expression.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value converted to a string matches the specified regular expression.static final <T> AssertionPredicate<T>Predicate that wraps another predicate.static final <T> AssertionPredicate<T>Predicate that wraps another predicate.static final <T> AssertionPredicate<T>Predicate that returnstrue if the tested value is the specified or child type.
- 
Constructor Details- 
AssertionPredicatesprotected AssertionPredicates()Constructor.
 
- 
- 
Method Details- 
anyPredicate that always returnstrue .Note that this typically has the same affect as a null predicate.- Type Parameters:
- T- The object type being tested.
- Returns:
- A new predicate.
 
- 
notNullPredicate that returnstrue if the tested value is not null.Assertion error message is "Value was null." .- Type Parameters:
- T- The object type being tested.
- Returns:
- A new predicate.
 
- 
isNullPredicate that returnstrue if the tested value is null.Assertion error message is "Value was not null." .- Type Parameters:
- T- The object type being tested.
- Returns:
- A new predicate.
 
- 
eqPredicate that returnstrue if the tested value equals the specified value.Uses standard Java equality for testing. Assertion error message is "Value did not match expected. Expected='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
eqPredicate that returnstrue if the tested value converted to a string matches the specified value.Assertion error message is "Value did not match expected. Expected='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
nePredicate that returnstrue if the tested value does not match the specified value.Assertion error message is "Value unexpectedly matched. Value='{0}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
nePredicate that returnstrue if the tested value converted to a string does not match the specified value.Assertion error message is "Value unexpectedly matched. Value='{0}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
eqicPredicate that returnstrue if the tested value converted to a string does not match the specified value ignoring case.Assertion error message is "Value did not match expected. Expected='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
containsPredicate that returnstrue if the tested value converted to a string contains the specified substring.Assertion error message is "Value did not contain expected. Expected='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
typePredicate that returnstrue if the tested value is the specified or child type.Assertion error message is "Value was not expected type. Expected='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- type- The specified type.
- Returns:
- A new predicate.
 
- 
exactTypePredicate that returnstrue if the tested value is exactly specified type.Assertion error message is "Value was not expected type. Expected='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- type- The specified type.
- Returns:
- A new predicate.
 
- 
matchPredicate that returnstrue if the tested value converted to a string matches the specified match pattern.Match pattern can contain the "*" meta-character.Assertion error message is "Value did not match pattern. Pattern='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The specified value.
- Returns:
- A new predicate.
 
- 
regexPredicate that returnstrue if the tested value converted to a string matches the specified regular expression.Assertion error message is "Value did not match pattern. Pattern='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- expression- The regular expression to match.
- Returns:
- A new predicate.
 
- 
regexPredicate that returnstrue if the tested value converted to a string matches the specified regular expression.Assertion error message is "Value did not match pattern. Pattern='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- expression- The regular expression to match.
- flags- Match flags, a bit mask that may include:
- Returns:
- A new predicate.
 
- 
regexPredicate that returnstrue if the tested value converted to a string matches the specified regular expression.Assertion error message is "Value did not match pattern. Pattern='{0}', Actual='{1}'." .- Type Parameters:
- T- The object type being tested.
- Parameters:
- value- The regular expression to match.
- Returns:
- A new predicate.
 
- 
testPredicate that wraps another predicate.If the predicate extends from AssertionPredicate, the assertion error message is"Value did not pass test." followed by the inner assertion error. Otherwise the message is"Value did not pass test. Value='{0}'." - Type Parameters:
- T- The object type being tested.
- Parameters:
- predicate- The predicate to run.
- Returns:
- A new predicate.
 
- 
testpublic static final <T> AssertionPredicate<T> test(Predicate<T> predicate, String msg, Object... args) Predicate that wraps another predicate.If the message specified is null and the predicate extends fromAssertionPredicate, the assertion error message is"Value did not pass test." followed by the inner assertion error. Otherwise the message is"Value did not pass test. Value='{0}'." - Type Parameters:
- T- The object type being tested.
- Parameters:
- predicate- The predicate to run.
- msg- The error message if predicate fails.
 Supports- MessageFormat-style arguments.
- args- Optional message arguments.
 Can contain- #VALUEto specify the value itself as an argument.
 Can contain- functionsto apply to the tested value.
- Returns:
- A new predicate.
 
- 
andCombines the specified predicates into a singled AND'ed predicate.Assertion error message is "Predicate test #x failed." followed by the inner failed message if the failed predicate extends fromAssertionPredicate.- Type Parameters:
- T- The predicate type.
- Parameters:
- predicates- The predicates to combine.
- Returns:
- The combined predicates.
 
- 
orCombines the specified predicates into a singled OR'ed predicate.Assertion error message is "No predicate tests passed." .- Type Parameters:
- T- The predicate type.
- Parameters:
- predicates- The predicates to combine.
- Returns:
- The combined predicates.
 
- 
notNegates the specified predicate.Assertion error message is "Predicate test unexpectedly passed." .- Type Parameters:
- T- The predicate type.
- Parameters:
- predicate- The predicate to negate.
- Returns:
- The combined predicates.
 
 
-