类 StringStartsWith
- java.lang.Object
- org.hamcrest.BaseMatcher<T>
- org.hamcrest.TypeSafeMatcher<String>
- org.hamcrest.core.SubstringMatcher
- org.hamcrest.core.StringStartsWith
- 所有已实现的接口:
Matcher<String>,SelfDescribing
public class StringStartsWith extends SubstringMatcher
Tests if the argument is a string that contains a substring.
字段概要
从类继承的字段 org.hamcrest.core.SubstringMatcher
substring
构造器概要
构造器 构造器 说明 StringStartsWith(String substring)
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 protected booleanevalSubstringOf(String s)protected Stringrelationship()static Matcher<String>startsWith(String prefix)从类继承的方法 org.hamcrest.core.SubstringMatcher
describeMismatchSafely, describeTo, matchesSafely
从类继承的方法 org.hamcrest.TypeSafeMatcher
describeMismatch, matches
从类继承的方法 org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
构造器详细资料
StringStartsWith
public StringStartsWith(String substring)
方法详细资料
evalSubstringOf
protected boolean evalSubstringOf(String s)
- 指定者:
evalSubstringOf在类中SubstringMatcher
relationship
protected String relationship()
- 指定者:
relationship在类中SubstringMatcher
startsWith
public static Matcher<String> startsWith(String prefix)
Creates a matcher that matches if the examinedStringstarts with the specifiedString. For example:assertThat("myStringOfNote", startsWith("my"))- 参数:
prefix- the substring that the returned matcher will expect at the start of any examined string