View Javadoc

1   package org.ddd4j.infrastructure.specification;
2   
3   public class AndSpecification<T> extends AbstractSpecification<T> {
4       private final Specification<T> x;
5       private final Specification<T> y;
6   
7       public AndSpecification(Specification<T> x, Specification<T> y) {
8           this.x = x;
9           this.y = y;
10      }
11  
12      public boolean isSatisfiedBy(T object) {
13          return x.isSatisfiedBy(object) && y.isSatisfiedBy(object);
14      }
15  }