Class DefaultConfiguration
java.lang.Object
de.muehlencord.shared.configuration.DefaultConfiguration
- All Implemented Interfaces:
Configuration
- Author:
- Joern Muehlencord (joern@muehlencord.de)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadds 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> voidsetParameterValue(Map<Parameter<T>, T> map) overrides parameter map with given map<T> voidsetParameterValueByString(Parameter<T> p, String stringValue) sets the value of the given parametervoidsetParameterValueByString(String parameterName, String stringValue) sets the value of the given parametervoidvalidates the configuration
-
Constructor Details
-
DefaultConfiguration
public DefaultConfiguration()creates a new instance of a configuration
-
-
Method Details
-
getParameterMap
returns the map of parameters and values- Specified by:
getParameterMapin interfaceConfiguration- Returns:
- the map of parameters and values
-
validateConfiguration
validates the configuration- Specified by:
validateConfigurationin interfaceConfiguration- Throws:
ConfigurationException- if the configuration is invalid
-
setParameterValue
overrides parameter map with given map- Type Parameters:
T- the type of the parameter to add- Parameters:
map- map to use- Throws:
ConfigurationException- if the parameter is not defined
-
setParameterValue
sets the value of parameter with given name- Specified by:
setParameterValuein interfaceConfiguration- 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
public void setParameterValueByString(String parameterName, String stringValue) throws ConfigurationException sets the value of the given parameter- Specified by:
setParameterValueByStringin interfaceConfiguration- Parameters:
parameterName- name of parameter to set the value forstringValue- value to set- Throws:
ConfigurationException- if the parameter is not defined
-
getParameterValue
returns the value of the given parameter- Specified by:
getParameterValuein interfaceConfiguration- 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
-