Matcher<T>
, SelfDescribing
public class StringEndsWith extends SubstringMatcher
substring
Constructor | Description |
---|---|
StringEndsWith(java.lang.String substring) |
Modifier and Type | Method | Description |
---|---|---|
static Matcher<java.lang.String> |
endsWith(java.lang.String suffix) |
Creates a matcher that matches if the examined
String ends with the specified
String . |
protected boolean |
evalSubstringOf(java.lang.String s) |
|
protected java.lang.String |
relationship() |
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
describeMismatchSafely, describeTo, matchesSafely
describeMismatch, matches
protected boolean evalSubstringOf(java.lang.String s)
evalSubstringOf
in class SubstringMatcher
protected java.lang.String relationship()
relationship
in class SubstringMatcher
public static Matcher<java.lang.String> endsWith(java.lang.String suffix)
String
ends with the specified
String
.
For example:
assertThat("myStringOfNote", endsWith("Note"))
suffix
- the substring that the returned matcher will expect at the end of any examined string