public class StringStartsWith extends SubstringMatcher
substring
Constructor and Description |
---|
StringStartsWith(boolean ignoringCase,
java.lang.String substring) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
evalSubstringOf(java.lang.String s) |
static Matcher<java.lang.String> |
startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined
String starts with the specified
String . |
static Matcher<java.lang.String> |
startsWithIgnoringCase(java.lang.String prefix)
Creates a matcher that matches if the examined
String starts with the specified
String , ignoring case |
converted, describeMismatchSafely, describeTo, matchesSafely
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public StringStartsWith(boolean ignoringCase, java.lang.String substring)
protected boolean evalSubstringOf(java.lang.String s)
evalSubstringOf
in class SubstringMatcher
public static Matcher<java.lang.String> startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined String
starts with the specified
String
.
assertThat("myStringOfNote", startsWith("my"))
prefix
- the substring that the returned matcher will expect at the start of any examined stringpublic static Matcher<java.lang.String> startsWithIgnoringCase(java.lang.String prefix)
Creates a matcher that matches if the examined String
starts with the specified
String
, ignoring case
assertThat("myStringOfNote", startsWith("my"))
prefix
- the substring that the returned matcher will expect at the start of any examined string