nand method

Spec<T> nand(
  1. Spec<T> other
)

Combines this spec with another using NAND logic (NOT AND).

Returns a new spec that is satisfied when it is NOT the case that both this spec and other are satisfied — i.e., at least one must fail. Equivalent to calling and followed by toNegated.

Prefer someSpec.and(other).toNegated() when readability matters. Use nand as a convenience when the negated-AND intent is central to the business rule.

Example:

// True unless both conditions hold simultaneously
final notBothAdmin = IsAdmin().nand(IsSuperuser());

Implementation

Spec<T> nand(Spec<T> other) => _Nand(this, other);