Constructor and Description |
---|
GeneralMatchers() |
Modifier and Type | Method and Description |
---|---|
static <T> org.hamcrest.Matcher<T> |
baseMatcher(String descriptionText,
Predicate<T> predicate)
Creates a matcher that matches when the given
predicate returns true. |
static <S,T extends S> |
typeSafeMatcher(Class<T> expectedType,
String descriptionText,
Predicate<T> predicate)
Creates a matcher that matches when the passed-in object is not null, is an instance of the given type,
and the given
predicate returns true when that object is passed into it. |
public static <T> org.hamcrest.Matcher<T> baseMatcher(String descriptionText, Predicate<T> predicate)
predicate
returns true.descriptionText
- describes what the matcher tries to match. Only appears when a match fails.public static <S,T extends S> org.hamcrest.Matcher<S> typeSafeMatcher(Class<T> expectedType, String descriptionText, Predicate<T> predicate)
predicate
returns true when that object is passed into it.descriptionText
- describes what the matcher tries to match. Only appears when a match fails.