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>

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

    • EMPTY

      public static final OrSpec<?> EMPTY
      The empty.
      Since:
      3.2
  • Constructor Details

    • OrSpec

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

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

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

    • isSatisfiedBy

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

      public OrSpec<T> or(Spec<? super T>... specs)
      Or.
      Since:
      3.2
    • empty

      public static <T> OrSpec<T> empty()
      Empty.
      Since:
      3.2