se.citerus.dddsample.domain.shared
Interface Specification<T>

All Known Implementing Classes:
AbstractSpecification, AndSpecification, NotSpecification, OrSpecification, RouteSpecification

public interface Specification<T>

Specificaiton interface.

Use AbstractSpecification as base for creating specifications, and only the method isSatisfiedBy(Object) must be implemented.


Method Summary
 Specification<T> and(Specification<T> specification)
          Create a new specification that is the AND operation of this specification and another specification.
 boolean isSatisfiedBy(T t)
          Check if t is satisfied by the specification.
 Specification<T> not(Specification<T> specification)
          Create a new specification that is the NOT operation of this specification.
 Specification<T> or(Specification<T> specification)
          Create a new specification that is the OR operation of this specification and another specification.
 

Method Detail

isSatisfiedBy

boolean isSatisfiedBy(T t)
Check if t is satisfied by the specification.

Parameters:
t - Object to test.
Returns:
true if t satisfies the specification.

and

Specification<T> and(Specification<T> specification)
Create a new specification that is the AND operation of this specification and another specification.

Parameters:
specification - Specification to AND.
Returns:
A new specification.

or

Specification<T> or(Specification<T> specification)
Create a new specification that is the OR operation of this specification and another specification.

Parameters:
specification - Specification to OR.
Returns:
A new specification.

not

Specification<T> not(Specification<T> specification)
Create a new specification that is the NOT operation of this specification.

Parameters:
specification - Specification to NOT.
Returns:
A new specification.


Copyright © 2009. All Rights Reserved.