Class DefaultConfiguration

java.lang.Object
de.simonkerstan.ee.core.configuration.DefaultConfiguration
All Implemented Interfaces:
Configuration

public final class DefaultConfiguration extends Object implements Configuration
Default configuration implementation.

FOR INTERNAL USE ONLY. THE API CAN CHANGE AT ANY TIME.

  • Constructor Details

    • DefaultConfiguration

      public DefaultConfiguration(String[] args)
      Create a new configuration instance.
      Parameters:
      args - Command line arguments
  • Method Details

    • getPropertyValue

      public <T> Optional<T> getPropertyValue(String propertyName, Class<T> type)
      Description copied from interface: Configuration
      Get the value of a configuration property.
      Specified by:
      getPropertyValue in interface Configuration
      Type Parameters:
      T - Type of the property value
      Parameters:
      propertyName - Name of the property
      type - Type of the property value
      Returns:
      Value of the property or empty if the property is missing
    • getPropertyValue

      public <T> T getPropertyValue(String propertyName, Class<T> type, T defaultValue)
      Description copied from interface: Configuration
      Get the value of a configuration property.
      Specified by:
      getPropertyValue in interface Configuration
      Type Parameters:
      T - Type of the property value
      Parameters:
      propertyName - Name of the property
      type - Type of the property value
      defaultValue - Default value if the property is missing
      Returns:
      Value of the property or the default value if the property is missing
    • getRequiredPropertyValue

      public <T> T getRequiredPropertyValue(String propertyName, Class<T> type) throws MissingConfigurationPropertyException
      Description copied from interface: Configuration
      Get a required value of a configuration property.
      Specified by:
      getRequiredPropertyValue in interface Configuration
      Type Parameters:
      T - Type of the property value
      Parameters:
      propertyName - Name of the property
      type - Type of the property value
      Returns:
      Value of the property
      Throws:
      MissingConfigurationPropertyException - If the property is missing
    • addConfigurationProvider

      public void addConfigurationProvider(ConfigurationProvider provider)
      Add a configuration provider.
      Parameters:
      provider - Configuration provider to be added