summaryrefslogtreecommitdiff
path: root/lib/NotSpecification.cs
blob: 72741a83c641d8efe956020efa021aeb2a5c8084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace jive
{
  public class NotSpecification<T> : Specification<T>
  {
    readonly Specification<T> item_to_match;

    public NotSpecification(Specification<T> item_to_match)
    {
      this.item_to_match = item_to_match;
    }

    public bool is_satisfied_by(T item)
    {
      return !item_to_match.is_satisfied_by(item);
    }
  }
}