|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of the constraintpublic interface ParameterConstraint<T>
Interface for specifying parameter constraints. Each class specifying a constraint addressing only one parameter should implement this interface. The constraint value for testing the parameter should be defined as private attribute and should be initialized in the respective constructor of the class, i.e. it is a parameter of the constructor. The proper constraint test should be implemented in the method
test(T)
.
Method Summary | |
---|---|
String |
getDescription(String parameterName)
Returns a description of this constraint. |
void |
test(T t)
Checks if the value t of the parameter to be tested fulfills the parameter constraint. |
Method Detail |
---|
void test(T t) throws ParameterException
t
of the parameter to be tested fulfills the parameter constraint.
If not, a parameter exception is thrown.
t
- Value to be checked whether or not it fulfills the underlying
parameter constraint.
ParameterException
- if the parameter to be tested does not
fulfill the parameter constraintString getDescription(String parameterName)
parameterName
- the name of the parameter this constraint is used for
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |