and method

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

Combines this spec with another using AND logic.

Equivalent to using the & operator. Returns a new spec that is satisfied only when both this spec and other are satisfied. Use when you want explicit method names for readability.

Example:

// Named method reads clearer for complex logic
final qualifiedApplicant = HasDegree().and(HasExperience()).and(PassedBackground());

Implementation

Spec<T> and(Spec<T> other) => _And(this, other);