Class OrSpec<T>
java.lang.Object
org.gradle.api.specs.CompositeSpec<T>
org.gradle.api.specs.OrSpec<T>
- Type Parameters:
T- The target type for this Spec
- All Implemented Interfaces:
Spec<T>
A
CompositeSpec which requires any one of its specs to be true in order to evaluate to
true. As an exception, an OrSpec with no specs is satisfied by every object.
Uses lazy evaluation: member specs are evaluated in order, stopping at the first satisfied one.
- Since:
- 0.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOrSpec()Creates a spec with no member specs, which is satisfied by every object.Creates a spec with the member specs of the given iterable, in iteration order.Creates a spec with the given member specs, in order. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> OrSpec<T> empty()Returns the sharedOrSpecwith no member specs, which is satisfied by every object.booleanisSatisfiedBy(T object) Returns whether the given element satisfies this spec.Returns anOrSpecwhose member specs are this spec's, followed by the given ones.Methods inherited from class CompositeSpec
equals, getSpecs, getSpecsArray, hashCode, isEmpty, toString, uncheckedCast
-
Field Details
-
EMPTY
The sharedOrSpecwith no member specs, satisfied by every object.- Since:
- 3.2
- See Also:
-
-
Constructor Details
-
OrSpec
public OrSpec()Creates a spec with no member specs, which is satisfied by every object.- Since:
- 3.0
- See Also:
-
OrSpec
-
OrSpec
-
-
Method Details
-
isSatisfiedBy
-
or
-
empty
Returns the sharedOrSpecwith no member specs, which is satisfied by every object.This is an exception to the usual rule that an empty disjunction is false. Like every
OrSpec, it is immutable, so it is a starting point for building a disjunction. Its vacuous truth is lost onceor(...)is called on it with at least one spec. AnOrSpecthat has it as a member is satisfied by every object.- Since:
- 3.2
-