# 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.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final AndSpec<?>`
`EMPTY`

## Constructor Summary

Constructors
Constructor
Description
`AndSpec()`
`AndSpec(Iterable<? extends Spec<? super T>> specs)`
`AndSpec(Spec<? super T>... specs)`

## Method Summary

Modifier and Type
Method
Description
`AndSpec<T>`
`and(Closure spec)`
`AndSpec<T>`
`and(Spec<? super T> spec)`
Typed and() method for a single `Spec`.
`AndSpec<T>`
`and(Spec<? super T>... specs)`
`static <T> AndSpec<T>`
`empty()`
`int`
`hashCode()`
`boolean`
`isSatisfiedBy(T object)`

### Methods inherited from class CompositeSpec

`equals, getSpecs, isEmpty`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### EMPTY

public static final AndSpec<?> EMPTY

## Constructor Details

### AndSpec

public AndSpec()

### AndSpec

public AndSpec(Spec<? super T>... specs)

### AndSpec

public AndSpec(Iterable<? extends Spec<? super T>> specs)

## Method Details

### isSatisfiedBy

public boolean isSatisfiedBy(T object)

### and

public AndSpec<T> and(Spec<? super T>... specs)

### and

@Incubating 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)

### empty

public static <T> AndSpec<T> empty()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `CompositeSpec<T>`