Interface Configuration

All Known Implementing Classes:
DefaultConfiguration

public interface Configuration
Specifies a configurable objects.
Author:
Joern Muehlencord (joern@muehlencord.de)
  • Method Details

    • addParameter

      <T> void addParameter(Parameter<T> p) throws ConfigurationException
      adds a new parameter to the configuration
      Type Parameters:
      T - the type of the parameter to add
      Parameters:
      p - the parameter to add
      Throws:
      ConfigurationException - if the parameter cannot be added
    • setParameterValue

      <T> void setParameterValue(Parameter<T> p, T value) throws ConfigurationException
      sets the value of the given parameter
      Type Parameters:
      T - the type of the parameter to add
      Parameters:
      p - the parameter to add
      value - the value the parameter should have
      Throws:
      ConfigurationException - if the parameter is not defined
    • setParameterValue

      <T> void setParameterValue(String parameterName, T value) throws ConfigurationException
      sets the value of parameter with given name
      Type Parameters:
      T - the type of the parameter to add
      Parameters:
      parameterName - parameter to set
      value - value to set
      Throws:
      ConfigurationException - if the parameter is not defined
    • setParameterValueByString

      <T> void setParameterValueByString(Parameter<T> p, String value) throws ConfigurationException
      sets the value of the given parameter
      Type Parameters:
      T - the type of the parameter to add
      Parameters:
      p - parameter to set
      value - 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 for
      stringValue - the value of the parameter as string
      Throws:
      ConfigurationException - if the parameter cannot be found or set
    • getParameterValue

      <T> T getParameterValue(Parameter<T> p) throws ConfigurationException
      returns the value of the given parameter
      Type Parameters:
      T - the type of the parameter to add
      Parameters:
      p - 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
    • getParameterValue

      <T> T getParameterValue(String parameterName) throws ConfigurationException
      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

      void validateConfiguration() throws ConfigurationException
      validates the configuration
      Throws:
      ConfigurationException - if the configuration is invalid
    • getParameterMap

      <T> Map<Parameter<T>,T> 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