public class AnyOf<T> extends BaseMatcher<T>
true
.Constructor and Description |
---|
AnyOf(Iterable<Matcher<? super T>> matchers) |
AnyOf(Matcher<? super T>... matchers) |
Modifier and Type | Method and Description |
---|---|
static <T> AnyOf<T> |
anyOf(Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers.
|
static <T> AnyOf<T> |
anyOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers.
|
void |
describeTo(Description description)
Generates a description of the object.
|
void |
describeTo(Description description,
String operator) |
boolean |
matches(Object o)
Evaluates the matcher for argument item.
|
protected boolean |
matches(Object o,
boolean shortcut) |
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
@SafeVarargs public AnyOf(Matcher<? super T>... matchers)
public boolean matches(Object o)
Matcher
matches
in interface Matcher<T>
o
- the object against which the matcher is evaluated.true
if item matches, otherwise false
.BaseMatcher
public void describeTo(Description description)
SelfDescribing
describeTo
in interface SelfDescribing
description
- The description to be built or appended to.public static <T> AnyOf<T> anyOf(Iterable<Matcher<? super T>> matchers)
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
@SafeVarargs public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers)
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
protected boolean matches(Object o, boolean shortcut)
public void describeTo(Description description, String operator)
Copyright © 2021. All rights reserved.