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>

public class AndSpec<T> extends CompositeSpec<T>
A CompositeSpec which requires all its specs to be true in order to evaluate to true. Uses lazy evaluation.
Since:
0.7
  • Field Details

    • EMPTY

      public static final AndSpec<?> EMPTY
      The empty.
      Since:
      3.1
  • Constructor Details

    • AndSpec

      public AndSpec()
      Creates a new AndSpec.
      Since:
      3.0
    • AndSpec

      @SafeVarargs public AndSpec(Spec<? super T>... specs)
      Creates a new AndSpec.
      Since:
      0.7
    • AndSpec

      public AndSpec(Iterable<? extends Spec<? super T>> specs)
      Creates a new AndSpec.
      Since:
      0.9
  • Method Details

    • isSatisfiedBy

      public boolean isSatisfiedBy(T object)
      Description copied from interface: Spec
      Returns whether satisfied by is set.
    • findUnsatisfiedSpec

      @Incubating public @Nullable Spec<? super T> findUnsatisfiedSpec(T object)
      Finds the first Spec that is not satisfied by the object.
      Parameters:
      object - to check specs against
      Returns:
      an unsatisfied spec or null
      Since:
      7.6
    • and

      @SafeVarargs public final AndSpec<T> and(Spec<? super T>... specs)
      And.
      Since:
      0.9
    • and

      public AndSpec<T> and(Spec<? super T> spec)
      Typed and() method for a single Spec.
      Since:
      4.3
    • and

      public AndSpec<T> and(Closure spec)
      And.
      Since:
      0.9
    • empty

      public static <T> AndSpec<T> empty()
      Empty.
      Since:
      3.1