Matcher<T>
, SelfDescribing
public class StringStartsWith extends SubstringMatcher
substring
Constructor | Description |
---|---|
StringStartsWith(java.lang.String substring) |
Modifier and Type | Method | Description |
---|---|---|
protected boolean |
evalSubstringOf(java.lang.String s) |
|
protected java.lang.String |
relationship() |
|
static Matcher<java.lang.String> |
startsWith(java.lang.String prefix) |
Creates a matcher that matches if the examined
String starts with the specified
String . |
_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> startsWith(java.lang.String prefix)
String
starts with the specified
String
.
For example:
assertThat("myStringOfNote", startsWith("my"))
prefix
- the substring that the returned matcher will expect at the start of any examined string