Interface ImmutableConfiguration

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String key)
      Check if the configuration contains the specified key.
      <T> T get​(java.lang.Class<T> cls, java.lang.String key)
      Get an object of the specified type associated with the given configuration key.
      <T> T get​(java.lang.Class<T> cls, java.lang.String key, T defaultValue)
      Get an object of the specified type associated with the given configuration key using a default value.
      java.lang.Object getArray​(java.lang.Class<?> cls, java.lang.String key)
      Get an array of typed objects associated with the given configuration key.
      java.lang.Object getArray​(java.lang.Class<?> cls, java.lang.String key, java.lang.Object defaultValue)
      Deprecated.
      This method should not be used any more because its signature does not allow type-safe invocations; use get(Class, String, Object) instead which offers the same functionality; for instance, to query for an array of ints use int[] result = config.get(int[].class, "myArrayKey", someDefault);.
      java.math.BigDecimal getBigDecimal​(java.lang.String key)
      Get a BigDecimal associated with the given configuration key.
      java.math.BigDecimal getBigDecimal​(java.lang.String key, java.math.BigDecimal defaultValue)
      Get a BigDecimal associated with the given configuration key.
      java.math.BigInteger getBigInteger​(java.lang.String key)
      Get a BigInteger associated with the given configuration key.
      java.math.BigInteger getBigInteger​(java.lang.String key, java.math.BigInteger defaultValue)
      Get a BigInteger associated with the given configuration key.
      boolean getBoolean​(java.lang.String key)
      Get a boolean associated with the given configuration key.
      boolean getBoolean​(java.lang.String key, boolean defaultValue)
      Get a boolean associated with the given configuration key.
      java.lang.Boolean getBoolean​(java.lang.String key, java.lang.Boolean defaultValue)
      Get a Boolean associated with the given configuration key.
      byte getByte​(java.lang.String key)
      Get a byte associated with the given configuration key.
      byte getByte​(java.lang.String key, byte defaultValue)
      Get a byte associated with the given configuration key.
      java.lang.Byte getByte​(java.lang.String key, java.lang.Byte defaultValue)
      Get a Byte associated with the given configuration key.
      <T> java.util.Collection<T> getCollection​(java.lang.Class<T> cls, java.lang.String key, java.util.Collection<T> target)
      Get a collection of typed objects associated with the given configuration key.
      <T> java.util.Collection<T> getCollection​(java.lang.Class<T> cls, java.lang.String key, java.util.Collection<T> target, java.util.Collection<T> defaultValue)
      Get a collection of typed objects associated with the given configuration key using the values in the specified default collection if the key does not map to an existing object.
      double getDouble​(java.lang.String key)
      Get a double associated with the given configuration key.
      double getDouble​(java.lang.String key, double defaultValue)
      Get a double associated with the given configuration key.
      java.lang.Double getDouble​(java.lang.String key, java.lang.Double defaultValue)
      Get a Double associated with the given configuration key.
      java.lang.String getEncodedString​(java.lang.String key)
      Get the value of a string property that is stored in encoded form in this configuration using a default ConfigurationDecoder.
      java.lang.String getEncodedString​(java.lang.String key, ConfigurationDecoder decoder)
      Get the value of a string property that is stored in encoded form in this configuration.
      float getFloat​(java.lang.String key)
      Get a float associated with the given configuration key.
      float getFloat​(java.lang.String key, float defaultValue)
      Get a float associated with the given configuration key.
      java.lang.Float getFloat​(java.lang.String key, java.lang.Float defaultValue)
      Get a Float associated with the given configuration key.
      int getInt​(java.lang.String key)
      Get a int associated with the given configuration key.
      int getInt​(java.lang.String key, int defaultValue)
      Get a int associated with the given configuration key.
      java.lang.Integer getInteger​(java.lang.String key, java.lang.Integer defaultValue)
      Get an Integer associated with the given configuration key.
      java.util.Iterator<java.lang.String> getKeys()
      Get the list of the keys contained in the configuration.
      java.util.Iterator<java.lang.String> getKeys​(java.lang.String prefix)
      Get the list of the keys contained in the configuration that match the specified prefix.
      <T> java.util.List<T> getList​(java.lang.Class<T> cls, java.lang.String key)
      Get a list of typed objects associated with the given configuration key returning an empty list if the key doesn't map to an existing object.
      <T> java.util.List<T> getList​(java.lang.Class<T> cls, java.lang.String key, java.util.List<T> defaultValue)
      Get a list of typed objects associated with the given configuration key returning the specified default value if the key doesn't map to an existing object.
      java.util.List<java.lang.Object> getList​(java.lang.String key)
      Get a List of the values associated with the given configuration key.
      java.util.List<java.lang.Object> getList​(java.lang.String key, java.util.List<?> defaultValue)
      Get a List of strings associated with the given configuration key.
      long getLong​(java.lang.String key)
      Get a long associated with the given configuration key.
      long getLong​(java.lang.String key, long defaultValue)
      Get a long associated with the given configuration key.
      java.lang.Long getLong​(java.lang.String key, java.lang.Long defaultValue)
      Get a Long associated with the given configuration key.
      java.util.Properties getProperties​(java.lang.String key)
      Get a list of properties associated with the given configuration key.
      java.lang.Object getProperty​(java.lang.String key)
      Gets a property from the configuration.
      short getShort​(java.lang.String key)
      Get a short associated with the given configuration key.
      short getShort​(java.lang.String key, short defaultValue)
      Get a short associated with the given configuration key.
      java.lang.Short getShort​(java.lang.String key, java.lang.Short defaultValue)
      Get a Short associated with the given configuration key.
      java.lang.String getString​(java.lang.String key)
      Get a string associated with the given configuration key.
      java.lang.String getString​(java.lang.String key, java.lang.String defaultValue)
      Get a string associated with the given configuration key.
      java.lang.String[] getStringArray​(java.lang.String key)
      Get an array of strings associated with the given configuration key.
      ImmutableConfiguration immutableSubset​(java.lang.String prefix)
      Return a decorator immutable Configuration containing every key from the current Configuration that starts with the specified prefix.
      boolean isEmpty()
      Check if the configuration is empty.
      int size()
      Returns the number of keys stored in this configuration.
    • Method Detail

      • isEmpty

        boolean isEmpty()
        Check if the configuration is empty.
        Returns:
        true if the configuration contains no property, false otherwise.
      • size

        int size()
        Returns the number of keys stored in this configuration. Note that a concrete implementation is not guaranteed to be efficient; for some implementations it may be expensive to determine the size. Especially, if you just want to check whether a configuration is empty, it is preferable to use the isEmpty() method.
        Returns:
        the number of keys stored in this configuration
      • containsKey

        boolean containsKey​(java.lang.String key)
        Check if the configuration contains the specified key.
        Parameters:
        key - the key whose presence in this configuration is to be tested
        Returns:
        true if the configuration contains a value for this key, false otherwise
      • getProperty

        java.lang.Object getProperty​(java.lang.String key)
        Gets a property from the configuration. This is the most basic get method for retrieving values of properties. In a typical implementation of the Configuration interface the other get methods (that return specific data types) will internally make use of this method. On this level variable substitution is not yet performed. The returned object is an internal representation of the property value for the passed in key. It is owned by the Configuration object. So a caller should not modify this object. It cannot be guaranteed that this object will stay constant over time (i.e. further update operations on the configuration may change its internal state).
        Parameters:
        key - property to retrieve
        Returns:
        the value to which this configuration maps the specified key, or null if the configuration contains no mapping for this key.
      • getKeys

        java.util.Iterator<java.lang.String> getKeys​(java.lang.String prefix)
        Get the list of the keys contained in the configuration that match the specified prefix. For instance, if the configuration contains the following keys:
        db.user, db.pwd, db.url, window.xpos, window.ypos,
        an invocation of getKeys("db");
        will return the keys below:
        db.user, db.pwd, db.url.
        Note that the prefix itself is included in the result set if there is a matching key. The exact behavior - how the prefix is actually interpreted - depends on a concrete implementation.
        Parameters:
        prefix - The prefix to test against.
        Returns:
        An Iterator of keys that match the prefix.
        See Also:
        getKeys()
      • getKeys

        java.util.Iterator<java.lang.String> getKeys()
        Get the list of the keys contained in the configuration. The returned iterator can be used to obtain all defined keys. It does not allow removing elements from this configuration via its remove() method.
        Returns:
        An Iterator.
      • getProperties

        java.util.Properties getProperties​(java.lang.String key)
        Get a list of properties associated with the given configuration key. This method expects the given key to have an arbitrary number of String values, each of which is of the form key=value. These strings are split at the equals sign, and the key parts will become keys of the returned Properties object, the value parts become values.
        Parameters:
        key - The configuration key.
        Returns:
        The associated properties if key is found.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a String/List.
        java.lang.IllegalArgumentException - if one of the tokens is malformed (does not contain an equals sign).
      • getBoolean

        boolean getBoolean​(java.lang.String key)
        Get a boolean associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated boolean.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Boolean.
      • getBoolean

        boolean getBoolean​(java.lang.String key,
                           boolean defaultValue)
        Get a boolean associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated boolean.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Boolean.
      • getBoolean

        java.lang.Boolean getBoolean​(java.lang.String key,
                                     java.lang.Boolean defaultValue)
        Get a Boolean associated with the given configuration key.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated boolean if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Boolean.
      • getByte

        byte getByte​(java.lang.String key)
        Get a byte associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated byte.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Byte.
      • getByte

        byte getByte​(java.lang.String key,
                     byte defaultValue)
        Get a byte associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated byte.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Byte.
      • getByte

        java.lang.Byte getByte​(java.lang.String key,
                               java.lang.Byte defaultValue)
        Get a Byte associated with the given configuration key.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated byte if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Byte.
      • getDouble

        double getDouble​(java.lang.String key)
        Get a double associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated double.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Double.
      • getDouble

        double getDouble​(java.lang.String key,
                         double defaultValue)
        Get a double associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated double.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Double.
      • getDouble

        java.lang.Double getDouble​(java.lang.String key,
                                   java.lang.Double defaultValue)
        Get a Double associated with the given configuration key.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated double if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Double.
      • getFloat

        float getFloat​(java.lang.String key)
        Get a float associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated float.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Float.
      • getFloat

        float getFloat​(java.lang.String key,
                       float defaultValue)
        Get a float associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated float.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Float.
      • getFloat

        java.lang.Float getFloat​(java.lang.String key,
                                 java.lang.Float defaultValue)
        Get a Float associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated float if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Float.
      • getInt

        int getInt​(java.lang.String key)
        Get a int associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated int.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Integer.
      • getInt

        int getInt​(java.lang.String key,
                   int defaultValue)
        Get a int associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated int.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Integer.
      • getInteger

        java.lang.Integer getInteger​(java.lang.String key,
                                     java.lang.Integer defaultValue)
        Get an Integer associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated int if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Integer.
      • getLong

        long getLong​(java.lang.String key)
        Get a long associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated long.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Long.
      • getLong

        long getLong​(java.lang.String key,
                     long defaultValue)
        Get a long associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated long.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Long.
      • getLong

        java.lang.Long getLong​(java.lang.String key,
                               java.lang.Long defaultValue)
        Get a Long associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated long if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Long.
      • getShort

        short getShort​(java.lang.String key)
        Get a short associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated short.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Short.
      • getShort

        short getShort​(java.lang.String key,
                       short defaultValue)
        Get a short associated with the given configuration key.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated short.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Short.
      • getShort

        java.lang.Short getShort​(java.lang.String key,
                                 java.lang.Short defaultValue)
        Get a Short associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated short if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a Short.
      • getBigDecimal

        java.math.BigDecimal getBigDecimal​(java.lang.String key)
        Get a BigDecimal associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated BigDecimal if key is found and has valid format
      • getBigDecimal

        java.math.BigDecimal getBigDecimal​(java.lang.String key,
                                           java.math.BigDecimal defaultValue)
        Get a BigDecimal associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated BigDecimal if key is found and has valid format, default value otherwise.
      • getBigInteger

        java.math.BigInteger getBigInteger​(java.lang.String key)
        Get a BigInteger associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated BigInteger if key is found and has valid format
      • getBigInteger

        java.math.BigInteger getBigInteger​(java.lang.String key,
                                           java.math.BigInteger defaultValue)
        Get a BigInteger associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated BigInteger if key is found and has valid format, default value otherwise.
      • getString

        java.lang.String getString​(java.lang.String key)
        Get a string associated with the given configuration key.
        Parameters:
        key - The configuration key.
        Returns:
        The associated string.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a String.
      • getString

        java.lang.String getString​(java.lang.String key,
                                   java.lang.String defaultValue)
        Get a string associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated string if key is found and has valid format, default value otherwise.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a String.
      • getEncodedString

        java.lang.String getEncodedString​(java.lang.String key,
                                          ConfigurationDecoder decoder)
        Get the value of a string property that is stored in encoded form in this configuration. This method obtains the value of the string property identified by the given key. This value is then passed to the provided ConfigurationDecoder. The value returned by the ConfigurationDecoder is passed to the caller. If the key is not associated with a value, the decoder is not invoked; depending on this configuration's settings either null is returned or an exception is thrown.
        Parameters:
        key - the configuration key
        decoder - the ConfigurationDecoder (must not be null)
        Returns:
        the plain string value of the specified encoded property
        Throws:
        java.lang.IllegalArgumentException - if a null decoder is passed
      • getEncodedString

        java.lang.String getEncodedString​(java.lang.String key)
        Get the value of a string property that is stored in encoded form in this configuration using a default ConfigurationDecoder. This method works like the method with the same name, but it uses a default ConfigurationDecoder associated with this configuration. It depends on a specific implementation how this default decoder is obtained.
        Parameters:
        key - the configuration key
        Returns:
        the plain string value of the specified encoded property
      • getStringArray

        java.lang.String[] getStringArray​(java.lang.String key)
        Get an array of strings associated with the given configuration key. If the key doesn't map to an existing object an empty array is returned
        Parameters:
        key - The configuration key.
        Returns:
        The associated string array if key is found.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a String/List of Strings.
      • getList

        java.util.List<java.lang.Object> getList​(java.lang.String key)
        Get a List of the values associated with the given configuration key. This method is different from the generic getList() method in that it does not recursively obtain all values stored for the specified property key. Rather, only the first level of the hierarchy is processed. So the resulting list may contain complex objects like arrays or collections - depending on the storage structure used by a concrete subclass. If the key doesn't map to an existing object, an empty List is returned.
        Parameters:
        key - The configuration key.
        Returns:
        The associated List.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a List.
      • getList

        java.util.List<java.lang.Object> getList​(java.lang.String key,
                                                 java.util.List<?> defaultValue)
        Get a List of strings associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        key - The configuration key.
        defaultValue - The default value.
        Returns:
        The associated List of strings.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not a List.
        See Also:
        getList(Class, String, List)
      • get

        <T> T get​(java.lang.Class<T> cls,
                  java.lang.String key)
        Get an object of the specified type associated with the given configuration key. If the key doesn't map to an existing object, the method returns null unless AbstractConfiguration.isThrowExceptionOnMissing() is set to true.
        Type Parameters:
        T - the target type of the value
        Parameters:
        cls - the target class of the value
        key - the key of the value
        Returns:
        the value of the requested type for the key
        Throws:
        java.util.NoSuchElementException - if the key doesn't map to an existing object and throwExceptionOnMissing=true
        ConversionException - if the value is not compatible with the requested type
        Since:
        2.0
      • get

        <T> T get​(java.lang.Class<T> cls,
                  java.lang.String key,
                  T defaultValue)
        Get an object of the specified type associated with the given configuration key using a default value. If the key doesn't map to an existing object, the default value is returned.
        Type Parameters:
        T - the target type of the value
        Parameters:
        cls - the target class of the value
        key - the key of the value
        defaultValue - the default value
        Returns:
        the value of the requested type for the key
        Throws:
        ConversionException - if the value is not compatible with the requested type
        Since:
        2.0
      • getArray

        java.lang.Object getArray​(java.lang.Class<?> cls,
                                  java.lang.String key)
        Get an array of typed objects associated with the given configuration key. If the key doesn't map to an existing object, an empty list is returned.
        Parameters:
        cls - the type expected for the elements of the array
        key - The configuration key.
        Returns:
        The associated array if the key is found, and the value compatible with the type specified.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not compatible with a list of the specified class.
        Since:
        2.0
      • getArray

        @Deprecated
        java.lang.Object getArray​(java.lang.Class<?> cls,
                                  java.lang.String key,
                                  java.lang.Object defaultValue)
        Deprecated.
        This method should not be used any more because its signature does not allow type-safe invocations; use get(Class, String, Object) instead which offers the same functionality; for instance, to query for an array of ints use int[] result = config.get(int[].class, "myArrayKey", someDefault);.
        Get an array of typed objects associated with the given configuration key. If the key doesn't map to an existing object, the default value is returned.
        Parameters:
        cls - the type expected for the elements of the array
        key - the configuration key.
        defaultValue - the default value
        Returns:
        The associated array if the key is found, and the value compatible with the type specified.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not compatible with an array of the specified class.
        java.lang.IllegalArgumentException - if the default value is not an array of the specified type
        Since:
        2.0
      • getList

        <T> java.util.List<T> getList​(java.lang.Class<T> cls,
                                      java.lang.String key)
        Get a list of typed objects associated with the given configuration key returning an empty list if the key doesn't map to an existing object.
        Type Parameters:
        T - the type expected for the elements of the list
        Parameters:
        cls - the class expected for the elements of the list
        key - The configuration key.
        Returns:
        The associated list if the key is found.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not compatible with a list of the specified class.
        Since:
        2.0
      • getList

        <T> java.util.List<T> getList​(java.lang.Class<T> cls,
                                      java.lang.String key,
                                      java.util.List<T> defaultValue)
        Get a list of typed objects associated with the given configuration key returning the specified default value if the key doesn't map to an existing object. This method recursively retrieves all values stored for the passed in key, i.e. if one of these values is again a complex object like an array or a collection (which may be the case for some concrete subclasses), all values are extracted and added to the resulting list - performing a type conversion if necessary.
        Type Parameters:
        T - the type expected for the elements of the list
        Parameters:
        cls - the class expected for the elements of the list
        key - the configuration key.
        defaultValue - the default value.
        Returns:
        The associated List.
        Throws:
        ConversionException - is thrown if the key maps to an object that is not compatible with a list of the specified class.
        Since:
        2.0
      • getCollection

        <T> java.util.Collection<T> getCollection​(java.lang.Class<T> cls,
                                                  java.lang.String key,
                                                  java.util.Collection<T> target)
        Get a collection of typed objects associated with the given configuration key. This method works like getCollection(Class, String, Collection, Collection) passing in null as default value.
        Type Parameters:
        T - the element type of the result list
        Parameters:
        cls - the the element class of the result list
        key - the configuration key
        target - the target collection (may be null)
        Returns:
        the collection to which data was added
        Throws:
        ConversionException - if the conversion is not possible
        Since:
        2.0
      • getCollection

        <T> java.util.Collection<T> getCollection​(java.lang.Class<T> cls,
                                                  java.lang.String key,
                                                  java.util.Collection<T> target,
                                                  java.util.Collection<T> defaultValue)
        Get a collection of typed objects associated with the given configuration key using the values in the specified default collection if the key does not map to an existing object. This method is similar to getList(), however, it allows specifying a target collection. Results are added to this collection. This is useful if the data retrieved should be added to a specific kind of collection, e.g. a set to remove duplicates. The return value is as follows:
        • If the key does not map to an existing object and the default value is null, the method returns null.
        • If the target collection is not null and data has been added (either from the resolved property value or from the default collection), the target collection is returned.
        • If the target collection is null and data has been added (either from the resolved property value or from the default collection), return value is the target collection created by this method.
        Type Parameters:
        T - the element type of the result list
        Parameters:
        cls - the the element class of the result list
        key - the configuration key
        target - the target collection (may be null)
        defaultValue - the default value (may be null)
        Returns:
        the collection to which data was added
        Throws:
        ConversionException - if the conversion is not possible
        Since:
        2.0
      • immutableSubset

        ImmutableConfiguration immutableSubset​(java.lang.String prefix)
        Return a decorator immutable Configuration containing every key from the current Configuration that starts with the specified prefix. The prefix is removed from the keys in the subset. For example, if the configuration contains the following properties:
            prefix.number = 1
            prefix.string = Apache
            prefixed.foo = bar
            prefix = Jakarta
        the immutable Configuration returned by subset("prefix") will contain the properties:
            number = 1
            string = Apache
            = Jakarta
        (The key for the value "Jakarta" is an empty string)
        Parameters:
        prefix - The prefix used to select the properties.
        Returns:
        a subset immutable configuration