Interface AttributeProvider

    • Method Detail

      • clone

        @Pure
        AttributeProvider clone()
        Make a deep copy of this object and replies the copy.
        Returns:
        the deep copy.
      • getAttributeCount

        @Pure
        int getAttributeCount()
        Replies the count of attributes.
        Returns:
        the count of attributes.
      • hasAttribute

        @Pure
        boolean hasAttribute​(String name)
        Replies if the given attribute exists.
        Parameters:
        name - the name.
        Returns:
        true is an attribute with the given name exists, otherwise false
      • getAllAttributes

        @Pure
        Collection<Attribute> getAllAttributes()
        Replies all the attributes.
        Returns:
        the list of all attributes
      • attributes

        @Pure
        Iterable<Attribute> attributes()
        Replies all the attributes.
        Returns:
        an iterable object that contains the attributes.
      • getAllAttributesByType

        @Pure
        Map<AttributeType,​Collection<Attribute>> getAllAttributesByType()
        Replies all the attributes sorted by type.

        The keys of the returned hashtable are the types and the values are array of attributes (Vector).

        Returns:
        the attributes grouped by type.
      • getAllAttributeNames

        @Pure
        Collection<String> getAllAttributeNames()
        Replies all the attribute names. This function never load the attribute values even if they are not inside the storage layer.
        Returns:
        the list of all attribute names.
      • getAttribute

        @Pure
        AttributeValue getAttribute​(String name)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value or null
      • getAttribute

        @Pure
        boolean getAttribute​(String name,
                             boolean defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        int getAttribute​(String name,
                         int defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        long getAttribute​(String name,
                          long defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        float getAttribute​(String name,
                           float defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        double getAttribute​(String name,
                            double defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        String getAttribute​(String name,
                            String defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        UUID getAttribute​(String name,
                          UUID defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        URL getAttribute​(String name,
                         URL defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        URI getAttribute​(String name,
                         URI defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        Date getAttribute​(String name,
                          Date defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        AttributeValue getAttribute​(String name,
                                    AttributeValue defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value or null
      • getAttribute

        @Pure
        InetAddress getAttribute​(String name,
                                 InetAddress defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        InetAddress getAttribute​(String name,
                                 InetSocketAddress defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        <T extends Enum<T>> T getAttribute​(String name,
                                           T defaultValue)
        Replies the value for the given attribute.
        Type Parameters:
        T - is the type of the enumeration.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttribute

        @Pure
        Class<?> getAttribute​(String name,
                              Class<?> defaultValue)
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        defaultValue - is the default value replied if the attribute has no value.
        Returns:
        the value
      • getAttributeObject

        @Pure
        Attribute getAttributeObject​(String name)
        Replies the attribute with the given name.
        Parameters:
        name - the name.
        Returns:
        the attribute or null
      • getAttributeAsBool

        @Pure
        boolean getAttributeAsBool​(String name)
                            throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsInt

        @Pure
        int getAttributeAsInt​(String name)
                       throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsLong

        @Pure
        long getAttributeAsLong​(String name)
                         throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsFloat

        @Pure
        float getAttributeAsFloat​(String name)
                           throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsDouble

        @Pure
        double getAttributeAsDouble​(String name)
                             throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsString

        @Pure
        String getAttributeAsString​(String name)
                             throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsUUID

        @Pure
        UUID getAttributeAsUUID​(String name)
                         throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsURL

        @Pure
        URL getAttributeAsURL​(String name)
                       throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsURI

        @Pure
        URI getAttributeAsURI​(String name)
                       throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsDate

        @Pure
        Date getAttributeAsDate​(String name)
                         throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsInetAddress

        @Pure
        InetAddress getAttributeAsInetAddress​(String name)
                                       throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsEnumeration

        @Pure
        Enum<?> getAttributeAsEnumeration​(String name)
                                   throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsEnumeration

        @Pure
        <T extends Enum<T>> T getAttributeAsEnumeration​(String name,
                                                        Class<T> type)
                                                 throws AttributeException
        Replies the value for the given attribute.
        Type Parameters:
        T - is the type of the enumeration to retreive.
        Parameters:
        name - the name.
        type - is the type of the enumeration to retreive.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • getAttributeAsJavaClass

        @Pure
        Class<?> getAttributeAsJavaClass​(String name)
                                  throws AttributeException
        Replies the value for the given attribute.
        Parameters:
        name - the name.
        Returns:
        the value
        Throws:
        AttributeException - if the attribute was never set.
      • freeMemory

        void freeMemory()
        Clean the internal memory-storage structures if they exist.

        This function permits to limit the memory usage without removing the attribute value from a hard storage area (database, files...). The attribute which are freed by this method could be reloaded in memory with a call to a getting method.

      • toMap

        @Pure
        default Map<String,​Object> toMap()
        Replies the map of the values stored in this attribute provider. The replied map is a copy of or an unmodifiable version of the internal map, if it exists.q
        Returns:
        the map, never null.
      • toMap

        void toMap​(Map<String,​Object> mapToFill)
        Fill the given map with the values stored in this attribute provider.
        Parameters:
        mapToFill - is the map to fill, never null.