Class AndSpec<T>
java.lang.Object
org.gradle.api.specs.CompositeSpec<T>
org.gradle.api.specs.AndSpec<T>
- Type Parameters:
T- The target type for this Spec
- All Implemented Interfaces:
Spec<T>
A
CompositeSpec which requires all its specs to be true in order to evaluate to true.
Uses lazy evaluation: member specs are evaluated in order, stopping at the first unsatisfied one.
- Since:
- 0.7
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAndSpec()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 TypeMethodDescriptionReturns anAndSpecwhose member specs are this spec's, followed by the closure as a spec.Returns anAndSpecwhose member specs are this spec's, followed by the given one.Returns anAndSpecwhose member specs are this spec's, followed by the given ones.static <T> AndSpec<T> empty()Returns the sharedAndSpecwith no member specs, which is vacuously satisfied by every object.findUnsatisfiedSpec(T object) Finds the firstSpecthat is not satisfied by the object.booleanisSatisfiedBy(T object) Returns whether the given element satisfies this spec.Methods inherited from class CompositeSpec
equals, getSpecs, getSpecsArray, hashCode, isEmpty, toString, uncheckedCast
-
Field Details
-
EMPTY
The sharedAndSpecwith no member specs, satisfied by every object.- Since:
- 3.1
- See Also:
-
-
Constructor Details
-
AndSpec
public AndSpec()Creates a spec with no member specs, which is satisfied by every object.- Since:
- 3.0
- See Also:
-
AndSpec
Creates a spec with the given member specs, in order.- Since:
- 0.7
-
AndSpec
-
-
Method Details
-
isSatisfiedBy
-
findUnsatisfiedSpec
-
and
Returns anAndSpecwhose member specs are this spec's, followed by the given ones.- Since:
- 0.9
-
and
-
and
-
empty
Returns the sharedAndSpecwith no member specs, which is vacuously satisfied by every object.Like every
AndSpec, it is immutable, so it is a starting point for building a conjunction. As a member, it does not change which objects satisfy a conjunction.- Since:
- 3.1
-