Class FreeFormTags

    • Constructor Detail

      • FreeFormTags

        public FreeFormTags​(String jsonString)
        Creates a new instance of FreeFormTags from JSON string input.
        Parameters:
        jsonString - a JSON string
      • FreeFormTags

        public FreeFormTags​(Map<String,​String> map)
        Creates a new instance of FreeFormTags from a Map
        Parameters:
        map - the map
    • Method Detail

      • addTag

        public FreeFormTags addTag​(String key,
                                   String value)
        Adds a new tag to the set of tags
        Parameters:
        key - the tag key
        value - the tag value
        Returns:
        this
      • getTag

        public String getTag​(String key)
        Returns the value of the named tag or null if it does not exist
        Parameters:
        key - the key
        Returns:
        the tag value or null
      • size

        public int size()
        Returns the number of tags in the set
        Returns:
        the size
      • contains

        public boolean contains​(String key)
        Returns true if the specified key exists in the tags map
        Parameters:
        key - the key
        Returns:
        true if the key exists
      • toString

        public String toString()
        Returns the free-form tags as a JSON string
        Overrides:
        toString in class Object
        Returns:
        the JSON string