org.hamcrest.core
Class StringStartsWith
java.lang.Object
   org.hamcrest.BaseMatcher<T>
org.hamcrest.BaseMatcher<T>
       org.hamcrest.TypeSafeMatcher<String>
org.hamcrest.TypeSafeMatcher<String>
           org.hamcrest.core.SubstringMatcher
org.hamcrest.core.SubstringMatcher
               org.hamcrest.core.StringStartsWith
org.hamcrest.core.StringStartsWith
- All Implemented Interfaces: 
- Matcher<String>, SelfDescribing
- public class StringStartsWith 
- extends SubstringMatcher
Tests if the argument is a string that contains a substring.
 
 
 
 
 
 
 
 
StringStartsWith
public StringStartsWith(String substring)
evalSubstringOf
protected boolean evalSubstringOf(String s)
- 
- Specified by:
- evalSubstringOfin class- SubstringMatcher
 
- 
 
relationship
protected String relationship()
- 
- Specified by:
- relationshipin class- SubstringMatcher
 
- 
 
startsWith
public static Matcher<String> startsWith(String prefix)
- Creates a matcher that matches if the examined Stringstarts with the specifiedString.
 
 For example:assertThat("myStringOfNote", startsWith("my"))
 
- 
- Parameters:
- prefix- the substring that the returned matcher will expect at the start of any examined string