Class Configuration

java.lang.Object
org.openhab.core.config.core.Configuration

public class Configuration extends Object
This class is a wrapper for configuration settings of org.openhab.core.thing.Things.
Author:
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 Details

    • 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.

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

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

    • as

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

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

      public Object get(String key)
    • put

      public Object put(String key, @Nullable Object value)
    • remove

      public Object remove(String key)
    • keySet

      public Set<String> keySet()
    • values

      public Collection<Object> values()
    • getProperties

      public Map<String,Object> getProperties()
    • setProperties

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object