AndSpec

open class AndSpec<T> : CompositeSpec<T> (source)

A org.gradle.api.specs.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

Parameters

<T>

The target type for this Spec

Constructors

Link copied to clipboard
constructor()
Creates a spec with no member specs, which is satisfied by every object.
constructor(specs: Array<Spec<in T>>)
Creates a spec with the given member specs, in order.
constructor(specs: Iterable<out Spec<in T>>)
Creates a spec with the member specs of the given iterable, in iteration order.

Properties

Link copied to clipboard
val EMPTY: AndSpec<out Any>
The shared AndSpec with no member specs, satisfied by every object.

Functions

Link copied to clipboard
open fun and(spec: Closure): AndSpec<T>
Returns an AndSpec whose member specs are this spec's, followed by the closure as a spec.
open fun and(spec: Spec<in T>): AndSpec<T>
Returns an AndSpec whose member specs are this spec's, followed by the given one.
fun and(specs: Array<Spec<in T>>): AndSpec<T>
Returns an AndSpec whose member specs are this spec's, followed by the given ones.
Link copied to clipboard
open fun <T> empty(): AndSpec<T>
Returns the shared AndSpec with no member specs, which is vacuously satisfied by every object.
Link copied to clipboard
fun equals(o: Any): Boolean
Link copied to clipboard
@Nullable
open fun findUnsatisfiedSpec(object: T): @Nullable Spec<in T>
Finds the first Spec that is not satisfied by the object.
Link copied to clipboard
open fun getSpecs(): List<Spec<in T>>
Returns an unmodifiable view of the member specs, in order.
Link copied to clipboard
fun hashCode(): Int
Link copied to clipboard
operator fun <T> Spec<T>.invoke(arg: T): Boolean

Enables function invocation syntax on Spec instances.

Link copied to clipboard
open fun isEmpty(): Boolean
Returns whether this spec has no member specs.
Link copied to clipboard
open fun isSatisfiedBy(object: T): Boolean
Returns whether the given element satisfies this spec.
Link copied to clipboard
open fun toString(): String