T - the expected enum typepublic class EnumParameter<T extends java.lang.Enum<T>> extends Parameter<T>
valueDescriptionsByName| Constructor and Description |
|---|
EnumParameter(java.lang.String name,
java.lang.String description,
T defaultValue,
T[] allValues,
java.lang.String[] valueDescriptions)
Initialises a new EnumParameter
|
| Modifier and Type | Method and Description |
|---|---|
T |
getValue(javax.servlet.http.HttpServletRequest request)
Returns the value of this parameter, as specified in the given request.
|
getDefaultValue, getDescription, getName, getValueForDescriptionpublic EnumParameter(java.lang.String name,
java.lang.String description,
T defaultValue,
T[] allValues,
java.lang.String[] valueDescriptions)
name - the name of the parameterdescription - a short description of what this parameter doesdefaultValue - the value to use when requests do not specify a value for this parameter (may be null)allValues - a list of all values for this enumvalueDescriptions - an array of short descriptions for each possible valuepublic T getValue(javax.servlet.http.HttpServletRequest request) throws java.lang.IllegalArgumentException
ParameterCopyright © 2012 David Milne. All Rights Reserved.