xnor method

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

Prefer someSpec.xor(other).toNegated() 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

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