Class Configuration

  • public class Configuration
    extends Object
    This class is a wrapper for configuration settings of Things.
    Dennis Nobel - Initial contribution, Kai Kreuzer - added constructors and normalization, Gerhard Riegler - added converting BigDecimal values to the type of the configuration class field, Chris Jackson - fix concurrent modification exception when removing properties, Markus Rathgeb - add copy constructor, Michael Riess - fix concurrent modification exception when setting properties, Michael Riess - fix equals() implementation
    • Constructor Detail

      • Configuration

        public Configuration()
      • Configuration

        public Configuration​(@Nullable Configuration configuration)
        Create a new configuration.

        The new configuration is initialized with the values of the given configuration.

        configuration - the configuration that should be cloned (may be null)
      • Configuration

        public Configuration​(@Nullable Map<String,​Object> properties)
        Create a new configuration.
        properties - the properties the configuration should be filled. If null, an empty configuration is created.
    • Method Detail

      • as

        public <T> T as​(Class<T> configurationClass)
      • containsKey

        public boolean containsKey​(String key)
        Check if the given key is present in the configuration.
        key - the key that existence should be checked
        true if the key is part of the configuration, false if not
      • setProperties

        public void setProperties​(Map<String,​Object> newProperties)
      • hashCode

        public int hashCode()
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable Object obj)
        equals in class Object