|
||||||||||
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 | |
---|---|
java.lang.Class<T> |
getType()
|
java.lang.Boolean |
isGeneralizationOf(Specification<? extends T> specification)
Specification subsumption. |
java.lang.Boolean |
isSatisfiedBy(T candidate)
Specification satisfaction. |
java.lang.Boolean |
isSpecialCaseOf(Specification<? super T> specification)
Specification subsumption. |
Method Detail |
---|
java.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> specification)
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]
specification
- 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> specification)
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]
specification
- The candidate specification
true
only if this specification is a special case of 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 |