Class Specs

java.lang.Object
org.gradle.api.specs.Specs

public class Specs extends Object
Provides a number of Spec implementations.
Since:
0.7
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Spec<Object>
    The shared spec that is satisfied by every object.
    static final Spec<Object>
    The shared spec that is satisfied by no object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Spec<T>
    Returns a spec satisfied by objects for which the closure returns a Groovy-true value.
    static <T> Spec<T>
    intersect(Collection<? extends Spec<? super T>> specs)
    Returns a spec that selects the intersection of those items selected by the given specs.
    static <T> Spec<T>
    intersect(Spec<? super T>... specs)
    Returns a spec that selects the intersection of those items selected by the given specs.
    static <T> Spec<T>
    negate(Spec<? super T> spec)
    Returns a spec that selects everything that is not selected by the given spec.
    static <T> Spec<T>
    Returns the shared spec that is satisfied by every object.
    static <T> Spec<T>
    Returns the shared spec that is satisfied by no object.
    static <T> Spec<T>
    union(Collection<? extends Spec<? super T>> specs)
    Returns a spec that selects the union of those items selected by the given specs.
    static <T> Spec<T>
    union(Spec<? super T>... specs)
    Returns a spec that selects the union of those items selected by the given specs.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SATISFIES_ALL

      public static final Spec<Object> SATISFIES_ALL
      The shared spec that is satisfied by every object.
      Since:
      0.7
    • SATISFIES_NONE

      public static final Spec<Object> SATISFIES_NONE
      The shared spec that is satisfied by no object.
      Since:
      1.0
  • Constructor Details

    • Specs

      public Specs()
  • Method Details

    • satisfyAll

      public static <T> Spec<T> satisfyAll()
      Returns the shared spec that is satisfied by every object.
      Since:
      0.7
    • satisfyNone

      public static <T> Spec<T> satisfyNone()
      Returns the shared spec that is satisfied by no object.
      Since:
      0.7
    • convertClosureToSpec

      public static <T> Spec<T> convertClosureToSpec(Closure<?> closure)
      Returns a spec satisfied by objects for which the closure returns a Groovy-true value.
      Since:
      0.9
    • intersect

      @SafeVarargs public static <T> Spec<T> intersect(Spec<? super T>... specs)
      Returns a spec that selects the intersection of those items selected by the given specs. Returns a spec that selects everything when no specs provided.
      Since:
      2.11
    • intersect

      public static <T> Spec<T> intersect(Collection<? extends Spec<? super T>> specs)
      Returns a spec that selects the intersection of those items selected by the given specs. Returns a spec that selects everything when no specs provided.
      Since:
      2.11
    • union

      @SafeVarargs public static <T> Spec<T> union(Spec<? super T>... specs)
      Returns a spec that selects the union of those items selected by the given specs. Selects everything when no specs provided.
      Since:
      2.11
    • union

      public static <T> Spec<T> union(Collection<? extends Spec<? super T>> specs)
      Returns a spec that selects the union of those items selected by the given specs. Selects everything when no specs provided.
      Since:
      2.11
    • negate

      public static <T> Spec<T> negate(Spec<? super T> spec)
      Returns a spec that selects everything that is not selected by the given spec.
      Since:
      2.11