xnor method

  1. @nonVirtual
Spec<T> xnor(
  1. Spec<T> other
)

Combines this spec with another using XNOR logic (NOT XOR / equivalence).

Returns a new spec that is satisfied when both specs have the same satisfaction state: either both satisfied or both unsatisfied. Equivalent to calling xor followed by negated.

Prefer someSpec.xor(other).negated() when readability matters. Use xnor as a convenience when the equivalence intent is central to the business rule.

Example:

// True when both conditions agree (both true or both false)
final syncedState = IsVerified().xnor(IsApproved());

Implementation

@nonVirtual
Spec<T> xnor(Spec<T> other) => _Xnor(this, other);