Class Parameter<T>
java.lang.Object
de.muehlencord.shared.configuration.Parameter<T>
- Type Parameters:
T- type of parameter
- Direct Known Subclasses:
BooleanParameter, DateParameter, IntegerParameter, StringParameter, URIParameter
- Author:
- Joern Muehlencord (joern@muehlencord.de)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Tthe default valueprotected Stringthe long description of this parameterprotected booleanboolean flag if this is a mandatory parameter or notprotected Stringthe name of the parameterlist of mandatory parameters, if this parameter is activeprotected StringConverter<T> the string converter to convert the object to string and back againoptional validatoroptional value list -
Constructor Summary
ConstructorsConstructorDescriptionParameter(String name, StringConverter<T> converter) creates a new mandatory string parameter objectParameter(String name, StringConverter<T> converter, boolean mandatory) creates a new string parameter object.Parameter(String name, StringConverter<T> converter, String description, boolean mandatory) creates a new string parameter object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequiredParameter(Parameter param) adds a parameter to the list of required parametersvoidaddValueList(T... values) booleangetName()returns the list of parameters the given parameter requiresinthashCode()booleanbooleanreturns true, if the given value is part of the possible value list or if the given value list is truevoidsetDefaultValue(T defaultValue) voidsetValidator(Validator<T> validator) toString()
-
Field Details
-
name
the name of the parameter -
description
the long description of this parameter -
mandatory
protected boolean mandatoryboolean flag if this is a mandatory parameter or not -
stringConverter
the string converter to convert the object to string and back again -
requiredParameters
-
validator
-
valueList
-
defaultValue
the default value
-
-
Constructor Details
-
Method Details
-
toString
-
getName
- Returns:
- the name
-
getDescription
- Returns:
- the description
-
isMandatory
public boolean isMandatory()- Returns:
- the mandatory
-
getStringConverter
- Returns:
- the stringConverter
-
getRequiredParameter
-
addValueList
-
getValueList
-
getDefaultValue
-
setDefaultValue
-
isValid
returns true, if the given value is part of the possible value list or if the given value list is true- Parameters:
value- the value to validate- Returns:
- true if no value list is defined or value is part of the value list; false otherwise
-
equals
-
hashCode
-