|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Specification<T>
Part of the Evans/Fowler Specifications pattern.
Note on type parameterization:Specification
for approval.
Generics should be used when creating specifications, making this specification type vs. candidate type a compile-time issue.
Method Summary | ||
---|---|---|
CompositeSpecification<T> |
and(Specification<? super T> otherSpecification)
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
|
|
java.lang.Class<T> |
getType()
|
|
java.lang.Boolean |
isDisjointWith(Specification<?> otherSpecification)
Two specifications are disjoint if the two sets of satisfiable objects have no objects in common. |
|
java.lang.Boolean |
isGeneralizationOf(Specification<? extends T> otherSpecification)
Specification subsumption. |
|
java.lang.Boolean |
isSatisfiedBy(T candidate)
Specification satisfaction. |
|
java.lang.Boolean |
isSpecialCaseOf(Specification<? super T> otherSpecification)
Specification subsumption. |
|
CompositeSpecification<T> |
or(Specification<? super T> otherSpecification)
Creates a disjunction out of two specifications: This composite specification The given specification parameter |
|
|
where(java.lang.String accessibleObjectName,
Specification<F> accessibleObjectSpecification)
Alias of and method. |
Method Detail |
---|
<F> CompositeSpecification<T> where(java.lang.String accessibleObjectName, Specification<F> accessibleObjectSpecification)
and
method.
F
- the type of the accessible object to specifyaccessibleObjectName
- the name of the accessible object to specifyaccessibleObjectSpecification
- the specification coupled to the accessible object
java.lang.IllegalArgumentException
- if any of the parameters are null
java.lang.UnsupportedOperationException
- if this method is called twice in the overall specification expression (fluent interface constraint)CompositeSpecification<T> and(Specification<? super T> otherSpecification)
java.lang.reflect.AccessibleObject
name parameter and the accompanying specification parameter
otherSpecification
- the specification to combine with this specification
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)CompositeSpecification<T> or(Specification<? super T> otherSpecification)
otherSpecification
- the specification to combine with this specification
java.lang.IllegalArgumentException
- if the parameter is nulljava.lang.Class<T> getType()
java.lang.Boolean isSatisfiedBy(T candidate)
candidate
- The candidate object
true
only if this specification is satisfied by/approves the given candidate (null
is never approved)java.lang.Boolean isGeneralizationOf(Specification<? extends T> otherSpecification)
Set K consisting of candidates specified by specA : specA.isSatisfiedBy(candidate)
Set L consisting of candidates specified by specB : specB.isSatisfiedBy(candidate)
if specA.isGeneralizationOf(specB) => Set K contains Set L [Set K UNION Set L = Set K]
otherSpecification
- The candidate specification
true
only if this specification is a generalization of the given candidate specification
java.lang.IllegalArgumentException
- if parameter is nulljava.lang.Boolean isSpecialCaseOf(Specification<? super T> otherSpecification)
Set K consisting of candidates specified by specA : specA.isSatisfiedBy(candidate)
Set L consisting of candidates specified by specB : specB.isSatisfiedBy(candidate)
if specA.isSpecializationOf(specB) => Set L contains Set K [Set K UNION Set L = Set L]
otherSpecification
- The candidate specification
true
only if this specification is a special case of the given candidate specification
java.lang.IllegalArgumentException
- if parameter is nulljava.lang.Boolean isDisjointWith(Specification<?> otherSpecification)
otherSpecification
- The candidate specification
true
only if this specification is disjoint with the given candidate specification
java.lang.IllegalArgumentException
- if parameter is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |