net.sourceforge.domian.specification
Interface CompositeSpecification<T>

All Superinterfaces:
Specification<T>

public interface CompositeSpecification<T>
extends Specification<T>

Part of the Evans/Fowler Specifications pattern.

Since:
0.1
Author:
Eirik Torske
See Also:
The Specifications Pattern

Method Summary
<F> CompositeSpecification<T>
and(java.lang.String accessibleObjectName, Specification<F> accessibleObjectSpecification)
          Creates a conjunction of two specifications:
  • This composite specification
  • A parameterized specification based on the java.lang.reflect.AccessibleObject name parameter and the accompanying specification parameter
  • <F> CompositeSpecification<T>
    or(java.lang.String accessibleObjectName, Specification<F> accessibleObjectSpecification)
              Creates a disjunction of two specifications:
  • This composite specification
  • A parameterized specification based on the java.lang.reflect.AccessibleObject name parameter and the accompanying specification parameter
  •  CompositeSpecification<T> remainderUnsatisfiedBy(T candidate)
              Partially satisfied specification.
     
    Methods inherited from interface net.sourceforge.domian.specification.Specification
    and, getType, isDisjointWith, isGeneralizationOf, isSatisfiedBy, isSpecialCaseOf, or, where
     

    Method Detail

    and

    <F> CompositeSpecification<T> and(java.lang.String accessibleObjectName,
                                      Specification<F> accessibleObjectSpecification)
    Creates a conjunction of two specifications:
    1. This composite specification
    2. A parameterized specification based on the java.lang.reflect.AccessibleObject name parameter and the accompanying specification parameter

    Type Parameters:
    F - the type of the accessible object to specify
    Parameters:
    accessibleObjectName - the name of the accessible object to specify
    accessibleObjectSpecification - the specification coupled to the accessible object
    Returns:
    a new composite specification: this specification AND the parameterized specification
    Throws:
    java.lang.IllegalArgumentException - if any of the parameters are null
    java.lang.IllegalArgumentException - if the accessible object name is illegal
    java.lang.IllegalArgumentException - if the type of the accessible object and the type of the specification are not compatible
    java.lang.UnsupportedOperationException - if this method is not placed behind a where clause in the overall specification expression (fluent interface constraint)

    or

    <F> CompositeSpecification<T> or(java.lang.String accessibleObjectName,
                                     Specification<F> accessibleObjectSpecification)
    Creates a disjunction of two specifications:
    1. This composite specification
    2. A parameterized specification based on the java.lang.reflect.AccessibleObject name parameter and the accompanying specification parameter

    Type Parameters:
    F - the type of the accessible object to specify
    Parameters:
    accessibleObjectName - the name of the accessible object to specify
    accessibleObjectSpecification - the specification coupled to the accessible object
    Returns:
    a new composite specification: this specification OR the parameterized specification
    Throws:
    java.lang.IllegalArgumentException - if any of the parameters are null
    java.lang.IllegalArgumentException - if the accessible object name is illegal
    java.lang.IllegalArgumentException - if the type of the accessible object and the type of the specification are not compatible
    java.lang.UnsupportedOperationException - if this method is not placed behind a where clause in the overall specification expression (fluent interface constraint)

    remainderUnsatisfiedBy

    CompositeSpecification<T> remainderUnsatisfiedBy(T candidate)
    Partially satisfied specification.

    Parameters:
    candidate - The candidate object
    Returns:
    A composite specification consisting of all this specification's components not satisfied by the given candidate object - or null if (in fact) this specification is satisfied by the candidate object
    Since:
    0.3


    Copyright © 2006-2010. All Rights Reserved.