se.citerus.dddsample.domain.shared
Class AbstractSpecification<T>

java.lang.Object
  extended by se.citerus.dddsample.domain.shared.AbstractSpecification<T>
All Implemented Interfaces:
Specification<T>
Direct Known Subclasses:
AndSpecification, NotSpecification, OrSpecification, RouteSpecification

public abstract class AbstractSpecification<T>
extends java.lang.Object
implements Specification<T>

Abstract base implementation of composite Specification with default implementations for and, or and not.


Constructor Summary
AbstractSpecification()
           
 
Method Summary
 Specification<T> and(Specification<T> specification)
          Create a new specification that is the AND operation of this specification and another specification.
abstract  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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSpecification

public AbstractSpecification()
Method Detail

isSatisfiedBy

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

Specified by:
isSatisfiedBy in interface Specification<T>
Parameters:
t - Object to test.
Returns:
true if t satisfies the specification.

and

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

Specified by:
and in interface Specification<T>
Parameters:
specification - Specification to AND.
Returns:
A new specification.

or

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

Specified by:
or in interface Specification<T>
Parameters:
specification - Specification to OR.
Returns:
A new specification.

not

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

Specified by:
not in interface Specification<T>
Parameters:
specification - Specification to NOT.
Returns:
A new specification.


Copyright © 2009. All Rights Reserved.