public class StringStartsWith extends SubstringMatcher
substring
Constructor and Description |
---|
StringStartsWith(boolean ignoringCase,
java.lang.String substring) |
StringStartsWith(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_, isNotNull, toString
public StringStartsWith(java.lang.String substring)
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", startsWithIgnoringCase("My"))
prefix
- the substring that the returned matcher will expect at the start of any examined string