public final class ParameterValidator extends Object
Modifier and Type | Field | Description |
---|---|---|
static String |
ASSERT_NONE_MESSAGE |
|
static String |
ASSERT_ONE_MESSAGE |
|
static String |
ASSERT_ONE_OR_LESS_MESSAGE |
Modifier and Type | Method | Description |
---|---|---|
static void |
assertNone(String paramName,
List<Parameter> parameters) |
Ensure a parameter doesn't occur in the specified list.
|
static void |
assertNullOrEqual(Parameter param,
List<Parameter> parameters) |
|
static void |
assertOne(String paramName,
List<Parameter> parameters) |
Ensure a parameter occurs once.
|
static void |
assertOneOrLess(String paramName,
List<Parameter> parameters) |
Ensure a parameter occurs no more than once.
|
public static final String ASSERT_NONE_MESSAGE
public static final String ASSERT_ONE_OR_LESS_MESSAGE
public static final String ASSERT_ONE_MESSAGE
public static void assertOneOrLess(String paramName, List<Parameter> parameters) throws ValidationException
paramName
- the parameter nameparameters
- a list of parameters to queryValidationException
- when the specified parameter occurs more than oncepublic static void assertOne(String paramName, List<Parameter> parameters) throws ValidationException
paramName
- the parameter nameparameters
- a list of parameters to queryValidationException
- when the specified parameter does not occur oncepublic static void assertNone(String paramName, List<Parameter> parameters) throws ValidationException
paramName
- the name of a parameterparameters
- a list of parametersValidationException
- thrown when the specified property
is found in the list of propertiespublic static void assertNullOrEqual(Parameter param, List<Parameter> parameters) throws ValidationException
param
- a parameter instanceparameters
- a list of parametersValidationException
- where the assertion fails