Interface Configuration
- All Known Implementing Classes:
DefaultConfiguration
public interface Configuration
Specifies a configurable objects.
- Author:
- Joern Muehlencord (joern@muehlencord.de)
-
Method Summary
Modifier and TypeMethodDescription<T> voidaddParameter(Parameter<T> p) adds a new parameter to the configurationreturns the map of parameters and values<T> TgetParameterValue(Parameter<T> p) returns the value of the given parameter<T> TgetParameterValue(String parameterName) returns the value of the given parameter<T> voidsetParameterValue(Parameter<T> p, T value) sets the value of the given parameter<T> voidsetParameterValue(String parameterName, T value) sets the value of parameter with given name<T> voidsetParameterValueByString(Parameter<T> p, String value) sets the value of the given parametervoidsetParameterValueByString(String parameterName, String stringValue) sets the value of the given parametervoidvalidates the configuration
-
Method Details
-
setParameterValue
sets the value of parameter with given name- Type Parameters:
T- the type of the parameter to add- Parameters:
parameterName- parameter to setvalue- value to set- Throws:
ConfigurationException- if the parameter is not defined
-
setParameterValueByString
void setParameterValueByString(String parameterName, String stringValue) throws ConfigurationException sets the value of the given parameter- Parameters:
parameterName- the name of the parameter to set the value forstringValue- the value of the parameter as string- Throws:
ConfigurationException- if the parameter cannot be found or set
-
getParameterValue
returns the value of the given parameter- Type Parameters:
T- the type of the parameter to add- Parameters:
parameterName- the name of the parameter to return the value for- Returns:
- the value of the given parameter; null if not set
- Throws:
ConfigurationException- if the parameter is not defined or if the value is not set
-
validateConfiguration
validates the configuration- Throws:
ConfigurationException- if the configuration is invalid
-
getParameterMap
returns the map of parameters and values- Type Parameters:
T- the type of the parameter to add- Returns:
- the map of parameters and values