public class StringStartsWith extends SubstringMatcher
substring
Constructor and Description |
---|
StringStartsWith(boolean ignoringCase,
String substring) |
StringStartsWith(String substring) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
evalSubstringOf(String s) |
static Matcher<String> |
startsWith(String prefix)
|
static Matcher<String> |
startsWithIgnoringCase(String prefix)
|
converted, describeMismatchSafely, describeTo, matchesSafely
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
public StringStartsWith(String substring)
public StringStartsWith(boolean ignoringCase, String substring)
protected boolean evalSubstringOf(String s)
evalSubstringOf
in class SubstringMatcher
public static Matcher<String> startsWith(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<String> startsWithIgnoringCase(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 stringCopyright © 2021. All rights reserved.