Package org.assertj.core.condition
Class AnyOf<T>
- java.lang.Object
-
- org.assertj.core.api.Condition<T>
-
- org.assertj.core.condition.Join<T>
-
- org.assertj.core.condition.AnyOf<T>
-
- Type Parameters:
T
- the type of object this condition accepts.
- All Implemented Interfaces:
Descriptable<Condition<T>>
public class AnyOf<T> extends Join<T>
Returnstrue
if any of the joined conditions is satisfied.- Author:
- Yvonne Wang, Mikhail Mazursky
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.assertj.core.api.Condition
Condition.Status
-
-
Field Summary
-
Fields inherited from class org.assertj.core.condition.Join
conditions, PREFIX_DELIMITER, SUFFIX_DELIMITER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Condition<T>
anyOf(Iterable<? extends Condition<? super T>> conditions)
Creates a newAnyOf
static <T> Condition<T>
anyOf(Condition<? super T>... conditions)
Creates a newAnyOf
String
descriptionPrefix()
method used to prefix the subclass join description, ex: "all of"boolean
matches(T value)
Verifies that the given value satisfies this condition.-
Methods inherited from class org.assertj.core.condition.Join
conditionDescriptionWithStatus, conditions, description
-
Methods inherited from class org.assertj.core.api.Condition
describedAs, status, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs
-
-
-
-
Method Detail
-
anyOf
@SafeVarargs public static <T> Condition<T> anyOf(Condition<? super T>... conditions)
Creates a newAnyOf
- Type Parameters:
T
- the type of object the given condition accept.- Parameters:
conditions
- the conditions to evaluate.- Returns:
- the created
AnyOf
. - Throws:
NullPointerException
- if the given array isnull
.NullPointerException
- if any of the elements in the given array isnull
.
-
anyOf
public static <T> Condition<T> anyOf(Iterable<? extends Condition<? super T>> conditions)
Creates a newAnyOf
- Type Parameters:
T
- the type of object the given condition accept.- Parameters:
conditions
- the conditions to evaluate.- Returns:
- the created
AnyOf
. - Throws:
NullPointerException
- if the given iterable isnull
.NullPointerException
- if any of the elements in the given iterable isnull
.
-
matches
public boolean matches(T value)
Verifies that the given value satisfies this condition.
-
descriptionPrefix
public String descriptionPrefix()
Description copied from class:Join
method used to prefix the subclass join description, ex: "all of"- Specified by:
descriptionPrefix
in classJoin<T>
- Returns:
- the prefix to use to build the description.
-
-