1 package se.citerus.dddsample.domain.shared;
2
3
4
5
6
7
8 public abstract class AbstractSpecification<T> implements Specification<T> {
9
10
11
12
13 public abstract boolean isSatisfiedBy(T t);
14
15
16
17
18 public Specification<T> and(final Specification<T> specification) {
19 return new AndSpecification<T>(this, specification);
20 }
21
22
23
24
25 public Specification<T> or(final Specification<T> specification) {
26 return new OrSpecification<T>(this, specification);
27 }
28
29
30
31
32 public Specification<T> not(final Specification<T> specification) {
33 return new NotSpecification<T>(specification);
34 }
35 }