Class PropertiesConfiguration

  • All Implemented Interfaces:
    io.confound.config.Configuration, io.confound.config.Parameters

    public class PropertiesConfiguration
    extends io.confound.config.AbstractStringConfiguration
    Configuration implementation backed by Properties.
    Author:
    Garret Wilson
    See Also:
    Properties, Properties.getProperty(String)
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertiesConfiguration​(java.util.Properties properties)
      Properties constructor.
      PropertiesConfiguration​(java.util.Properties properties, io.confound.config.Configuration parentConfiguration)
      Parent configuration and properties constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Optional<java.lang.String> findParameterImpl​(java.lang.String key)
      This implementation delegates to Properties.getProperty(String).
      protected boolean hasParameterImpl​(java.lang.String key)
      This implementation delegates to Properties.contains(Object).
      • Methods inherited from class io.confound.config.AbstractStringConfiguration

        dereferenceString, findParameter, getOptionalBoolean, getOptionalDouble, getOptionalInt, getOptionalLong, getOptionalPath, getOptionalString, getOptionalUri
      • Methods inherited from class io.confound.config.BaseConfiguration

        getOptionalParameter, hasParameter, normalizeKey
      • Methods inherited from class io.confound.config.AbstractConfiguration

        getParentConfiguration, or
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.confound.config.Parameters

        getBoolean, getDouble, getInt, getLong, getParameter, getPath, getString, getUri, requireParameter, resolvePath
    • Constructor Detail

      • PropertiesConfiguration

        public PropertiesConfiguration​(@Nonnull
                                       java.util.Properties properties)
        Properties constructor.
        Parameters:
        properties - The properties to back this configuration.
        Throws:
        java.lang.NullPointerException - if the given properties is null.
      • PropertiesConfiguration

        public PropertiesConfiguration​(@Nonnull
                                       java.util.Properties properties,
                                       @Nullable
                                       io.confound.config.Configuration parentConfiguration)
        Parent configuration and properties constructor.
        Parameters:
        properties - The properties to back this configuration.
        parentConfiguration - The parent configuration to use for fallback lookup, or null if there is no parent configuration.
        Throws:
        java.lang.NullPointerException - if the given properties is null.
    • Method Detail

      • hasParameterImpl

        protected boolean hasParameterImpl​(java.lang.String key)
                                    throws io.confound.config.ConfigurationException
        This implementation delegates to Properties.contains(Object).
        Overrides:
        hasParameterImpl in class io.confound.config.BaseConfiguration<java.lang.String>
        Throws:
        io.confound.config.ConfigurationException
      • findParameterImpl

        protected java.util.Optional<java.lang.String> findParameterImpl​(java.lang.String key)
                                                                  throws io.confound.config.ConfigurationException
        This implementation delegates to Properties.getProperty(String).
        Specified by:
        findParameterImpl in class io.confound.config.BaseConfiguration<java.lang.String>
        Throws:
        io.confound.config.ConfigurationException