Package org.hamcrest.core
Class StringStartsWith
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<String>
org.hamcrest.core.SubstringMatcher
org.hamcrest.core.StringStartsWith
- All Implemented Interfaces:
Matcher<String>,SelfDescribing
Tests if the argument is a string that starts with a specific substring.
-
Field Summary
Fields inherited from class org.hamcrest.core.SubstringMatcher
substring -
Constructor Summary
ConstructorsConstructorDescriptionStringStartsWith(boolean ignoringCase, String substring) StringStartsWith(String substring) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstartsWith(String prefix) startsWithIgnoringCase(String prefix) Methods inherited from class org.hamcrest.core.SubstringMatcher
converted, describeMismatchSafely, describeTo, matchesSafelyMethods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matchesMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Constructor Details
-
StringStartsWith
-
StringStartsWith
-
-
Method Details
-
evalSubstringOf
- Specified by:
evalSubstringOfin classSubstringMatcher
-
startsWith
Creates a matcher that matches if the examined
For example:Stringstarts with the specifiedString.assertThat("myStringOfNote", startsWith("my"))- Parameters:
prefix- the substring that the returned matcher will expect at the start of any examined string
-
startsWithIgnoringCase
Creates a matcher that matches if the examined
For example:Stringstarts with the specifiedString, ignoring caseassertThat("myStringOfNote", startsWithIgnoringCase("My"))- Parameters:
prefix- the substring that the returned matcher will expect at the start of any examined string
-