Class PropertyMap

  • All Implemented Interfaces:
    Property, java.io.Serializable

    public class PropertyMap
    extends java.lang.Object
    implements Property, java.io.Serializable
    A property consisting of multiple key-value-pairs.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.util.Collection<java.lang.String> getKeys()  
      Property getValue​(java.lang.String key)
      Get the Values defined for a given key.
      int hashCode()  
      PropertyList setListValue​(java.lang.String key)
      Shorthand for setValue(key, new PropertyList())
      PropertyMap setMapValue​(java.lang.String key)
      Shorthand for setValue(key, new PropertyMap())
      void setValue​(java.lang.String key, boolean value)
      Shorthand for setValue(key, new PropertyBool(value))
      void setValue​(java.lang.String key, double value)
      Shorthand for setValue(key, new PropertyDecimal(value))
      void setValue​(java.lang.String key, int value)
      Shorthand for setValue(key, new PropertyInt(value))
      void setValue​(java.lang.String key, long value)
      Shorthand for setValue(key, new PropertyLong(value))
      void setValue​(java.lang.String key, Property value)
      Assign a property value to a given key.Already existing properties will be overwritten.
      void setValue​(java.lang.String key, java.lang.String value)
      Shorthand for setValue(key, new PropertyString(value))
      java.lang.String toString()  
      void toString​(java.lang.StringBuffer buffer, java.lang.String indentation)
      Fills the given StringBuffer with a clear String-representation of all (possibly nested) property values of this Property object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PropertyMap

        public PropertyMap()
    • Method Detail

      • getKeys

        public java.util.Collection<java.lang.String> getKeys()
        Returns:
        Returns a set of all keys
      • getValue

        public Property getValue​(java.lang.String key)
        Get the Values defined for a given key.
        Parameters:
        key - The key
        Returns:
        The value that is stored in the map for this key.
      • setValue

        public void setValue​(java.lang.String key,
                             Property value)
        Assign a property value to a given key.Already existing properties will be overwritten.
        Parameters:
        key - The property key
        value - The property value that shall be assigned to this key.
      • setValue

        public void setValue​(java.lang.String key,
                             boolean value)
        Shorthand for setValue(key, new PropertyBool(value))
        Parameters:
        key - The property key
        value - The boolean value that shall be assigned to this key.
      • setValue

        public void setValue​(java.lang.String key,
                             double value)
        Shorthand for setValue(key, new PropertyDecimal(value))
        Parameters:
        key - The property key
        value - The double value that shall be assigned to this key.
      • setValue

        public void setValue​(java.lang.String key,
                             int value)
        Shorthand for setValue(key, new PropertyInt(value))
        Parameters:
        key - The property key
        value - The integer property value that shall be assigned to this key.
      • setValue

        public void setValue​(java.lang.String key,
                             long value)
        Shorthand for setValue(key, new PropertyLong(value))
        Parameters:
        key - The property key
        value - The long integer property value that shall be assigned to this key.
      • setValue

        public void setValue​(java.lang.String key,
                             java.lang.String value)
        Shorthand for setValue(key, new PropertyString(value))
        Parameters:
        key - The property key
        value - The String property value that shall be assigned to this key.
      • setListValue

        public PropertyList setListValue​(java.lang.String key)
        Shorthand for setValue(key, new PropertyList())
        Parameters:
        key - The property key
        Returns:
        the new PropertyList
      • setMapValue

        public PropertyMap setMapValue​(java.lang.String key)
        Shorthand for setValue(key, new PropertyMap())
        Parameters:
        key - The property key
        Returns:
        the new PropertyMap
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toString

        public void toString​(java.lang.StringBuffer buffer,
                             java.lang.String indentation)
        Description copied from interface: Property
        Fills the given StringBuffer with a clear String-representation of all (possibly nested) property values of this Property object.

        For that, the given String indentation is used initially and each additional element is shifted by additional whitespaces.

        Specified by:
        toString in interface Property
        Parameters:
        buffer - buffer to append the property to
        indentation - String representing the current indentation.
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object