T
- Parameter typepublic class ListSizeConstraint<T> extends Object implements ParameterConstraint<List<T>>
ListParameter
) to be tested has to be equal to the specified list
size constraint.Modifier and Type | Field and Description |
---|---|
private int |
sizeConstraint
The list size constraint.
|
Constructor and Description |
---|
ListSizeConstraint(int size)
Constructs a list size constraint with the given constraint size.
|
public ListSizeConstraint(int size)
size
- the size constraint for the list parameterpublic void test(List<T> t) throws ParameterException
test
in interface ParameterConstraint<List<T>>
t
- Value to be checked whether or not it fulfills the underlying
parameter constraint.ParameterException,
- if the size of the list parameter given is not
equal to the list size constraint specified.ParameterException
- if the parameter to be tested does not
fulfill the parameter constraintpublic String getDescription(String parameterName)
ParameterConstraint
getDescription
in interface ParameterConstraint<List<T>>
parameterName
- the name of the parameter this constraint is used for