Interface AttributeCollection

    • Method Detail

      • setAttributes

        void setAttributes​(Map<String,​Object> content)
        Set the content of this collection from the given map. Any previous content of this attribute collection will be lost. This function is equivalent to:
        
         this.removeAllAttributes();
         this.addAttributes(content);
         
        Parameters:
        content - is the content.
        See Also:
        addAttributes(Map)
      • setAttributes

        void setAttributes​(AttributeProvider content)
                    throws AttributeException
        Set the content of this collection from the given map. Any previous content of this attribute collection will be lost. This function is equivalent to:
        
         this.removeAllAttributes();
         this.addAttributes(content);
         
        Parameters:
        content - is the content.
        Throws:
        AttributeException - if one attribute from the content cannot be inserted.
        See Also:
        addAttributes(AttributeProvider)
      • addAttributes

        void addAttributes​(Map<String,​Object> content)
        Put the values given as parameter in this attribute provider. Any previous content of this attribute collection will remain if the keys are not inside the given content. If the values from the given content will be used to overwrite any existing value.
        Parameters:
        content - is the content to add inside.
        See Also:
        setAttributes(Map)
      • addAttributes

        void addAttributes​(AttributeProvider content)
                    throws AttributeException
        Put the values given as parameter in this attribute provider. Any previous content of this attribute collection will remain if the keys are not inside the given content. If the values from the given content will be used to overwrite any existing value.
        Parameters:
        content - is the content to add inside.
        Throws:
        AttributeException - if one attribute from the content cannot be inserted.
        See Also:
        addAttributes(AttributeProvider)
      • setAttribute

        Attribute setAttribute​(String name,
                               boolean value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               int value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               long value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               float value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               double value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               String value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               UUID value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               URL value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               URI value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               Date value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               InetAddress value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               InetSocketAddress value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               Enum<?> value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttribute

        Attribute setAttribute​(String name,
                               Class<?> value)
        Set the value for the given attribute.
        Parameters:
        name - is the name of the attribute to set.
        value - is the value to store.
        Returns:
        the changed attribute or null
      • setAttributeType

        Attribute setAttributeType​(String name,
                                   AttributeType type)
                            throws AttributeException
        Set the type of the attribute with the given name.
        Parameters:
        name - is the name of the attribute
        type - is the desired type.
        Returns:
        the changed attribute or null
        Throws:
        AttributeException - on error.
        Since:
        4.0
      • removeAttribute

        boolean removeAttribute​(String name)
        Remove the given attribute.
        Parameters:
        name - is the name of the attribute to remove.
        Returns:
        true on success, otherwhise false
      • removeAllAttributes

        boolean removeAllAttributes()
        Remove all the attributes.
        Returns:
        false if something wrong appends
      • renameAttribute

        boolean renameAttribute​(String oldname,
                                String newname)
        Rename the attribute.

        If a attribute named newname already exists, this function will reply false.

        This function is equivalent to renameAttribute(oldname, newname, false).

        Parameters:
        oldname - is the name of the attribute to rename.
        newname - is the new name of the attribute.
        Returns:
        false if something wrong appends
      • renameAttribute

        boolean renameAttribute​(String oldname,
                                String newname,
                                boolean overwrite)
        Rename the attribute .
        Parameters:
        oldname - is the name of the attribute to rename.
        newname - is the new name of the attribute.
        overwrite - must be true if the value of an existing attribute named by newname must be overwritten by the value of the attribute named oldname.
        Returns:
        false if something wrong appends
      • addAttributeChangeListener

        void addAttributeChangeListener​(AttributeChangeListener listener)
        Add a listener on the attribute value changes.
        Parameters:
        listener - the listener.
      • removeAttributeChangeListener

        void removeAttributeChangeListener​(AttributeChangeListener listener)
        Remove a listener on the attribute value changes.
        Parameters:
        listener - the listener.
      • isEventFirable

        @Pure
        boolean isEventFirable()
        Replies if the events are fired by this container.
        Returns:
        true if the events are fired; otherwise false if events are not fired.
      • setEventFirable

        void setEventFirable​(boolean isFirable)
        Set if the events are fired by this container.
        Parameters:
        isFirable - is true if the events are fired; otherwise false if events are not fired.
      • flush

        void flush()
        Force this provider to synchronized the memory state of the attributes with a remote storage area.