Class Attributes

    • Constructor Detail

      • Attributes

        public Attributes()
        Instantiates a new Attributes.
      • Attributes

        public Attributes​(String collection)
        Instantiates a new Attributes.
        Parameters:
        collection - the collection
    • Method Detail

      • set

        public Attributes set​(String key,
                              String value)
        Adds a key-value pair to the attributes and returns the updated Attributes object.
        Parameters:
        key - The key is a string that represents the attribute name. It is used to identify the attribute in the attributes.
        value - The value parameter is a string that represents the value to be associated with the given key in the attributes.
        Returns:
        The method is returning an instance of the Attributes class.
      • get

        public String get​(String key)
        Retrieves the value associated with a given key from a Attributes.
        Parameters:
        key - The "key" parameter is a String that represents the key of the attribute that you want to retrieve from the attributes.
        Returns:
        The method is returning the value associated with the given key in the attributes.
      • hasKey

        public boolean hasKey​(String key)
        Check whether a key exists in the attributes.
        Parameters:
        key - the key
        Returns:
        the boolean
      • setAttributes

        public void setAttributes​(Map<String,​String> attributes)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object