类 AllOf<T>
- java.lang.Object
- org.hamcrest.BaseMatcher<T>
- org.hamcrest.DiagnosingMatcher<T>
- org.hamcrest.core.AllOf<T>
- 所有已实现的接口:
Matcher<T>
,SelfDescribing
public class AllOf<T> extends DiagnosingMatcher<T>
Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher returnsfalse
.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static <T> Matcher<T>
allOf(Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.static <T> Matcher<T>
allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.static <T> Matcher<T>
allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth, Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers.void
describeTo(Description description)
Generates a description of the object.boolean
matches(Object o, Description mismatch)
从类继承的方法 org.hamcrest.DiagnosingMatcher
describeMismatch, matches
从类继承的方法 org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
方法详细资料
matches
public boolean matches(Object o, Description mismatch)
- 指定者:
matches
在类中DiagnosingMatcher<T>
describeTo
public void describeTo(Description description)
从接口复制的说明:SelfDescribing
Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.- 参数:
description
- The description to be built or appended to.
allOf
public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
allOf
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
allOf
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
allOf
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
allOf
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
allOf
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
allOf
public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third, Matcher<? super T> fourth, Matcher<? super T> fifth, Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. For example:assertThat("myValue", allOf(startsWith("my"), containsString("Val")))