Class PredicateMatcher<T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
io.github.cjstehno.testthings.match.PredicateMatcher<T>
- Type Parameters:
T
- the matched type
- All Implemented Interfaces:
org.hamcrest.Matcher<T>
,org.hamcrest.SelfDescribing
public class PredicateMatcher<T>
extends org.hamcrest.BaseMatcher<T>
A Hamcrest matcher used to wrap a
Predicate
where the matcher will match if the predicate resolves to true
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) boolean
static <T> org.hamcrest.Matcher<T>
matchesPredicate
(Predicate<T> predicate) Creates the predicate matcher with a default description ("a supplied predicate").static <T> org.hamcrest.Matcher<T>
matchesPredicate
(Predicate<T> predicate, String descr) Creates the predicate matcher with the provided description.Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
-
Constructor Details
-
PredicateMatcher
public PredicateMatcher()
-
-
Method Details
-
matchesPredicate
Creates the predicate matcher with a default description ("a supplied predicate").- Type Parameters:
T
- the matched type- Parameters:
predicate
- the predicate- Returns:
- the matcher
-
matchesPredicate
Creates the predicate matcher with the provided description.- Type Parameters:
T
- the matched type- Parameters:
predicate
- the predicatedescr
- the description- Returns:
- the matcher
-
matches
-
describeTo
public void describeTo(org.hamcrest.Description description)
-