Matcher<java.lang.String>, SelfDescribingpublic 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_, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeMismatchSafely, describeTo, matchesSafelydescribeMismatch, matchesprotected boolean evalSubstringOf(java.lang.String s)
evalSubstringOf in class SubstringMatcherprotected java.lang.String relationship()
relationship in class SubstringMatcherpublic 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