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

java.lang.Object
  extended by se.citerus.dddsample.domain.shared.AbstractSpecification<T>
      extended by se.citerus.dddsample.domain.shared.AndSpecification<T>
All Implemented Interfaces:
Specification<T>

public class AndSpecification<T>
extends AbstractSpecification<T>

AND specification, used to create a new specifcation that is the AND of two other specifications.


Constructor Summary
AndSpecification(Specification<T> spec1, Specification<T> spec2)
          Create a new AND specification based on two other spec.
 
Method Summary
 boolean isSatisfiedBy(T t)
          Check if t is satisfied by the specification.
 
Methods inherited from class se.citerus.dddsample.domain.shared.AbstractSpecification
and, not, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndSpecification

public AndSpecification(Specification<T> spec1,
                        Specification<T> spec2)
Create a new AND specification based on two other spec.

Parameters:
spec1 - Specification one.
spec2 - Specification two.
Method Detail

isSatisfiedBy

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

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


Copyright © 2009. All Rights Reserved.