Class AggregateAttributes

  • All Implemented Interfaces:
    Attributes

    public class AggregateAttributes
    extends Object
    implements Attributes
    An implementation of Attributes aggregating multiple instances. Attributes are aggregated on a 'first defined wins' basis, i.e. the first definition of a specific attribute is the one used and remaining definitions are discarded.
    Author:
    Darran Lofthouse
    • Method Detail

      • entries

        public Collection<Attributes.Entry> entries()
        Description copied from interface: Attributes
        Get the entry collection. Changes to the entry collection will modify this attribute collection, if it is writable. The returned entries will remain up to date with the state of this collection.
        Specified by:
        entries in interface Attributes
        Returns:
        the entry collection
      • size

        public int size​(String key)
        Description copied from interface: Attributes
        Get the number of values mapped to the given key.
        Specified by:
        size in interface Attributes
        Parameters:
        key - the key
        Returns:
        the number of mapped values
      • get

        public Attributes.Entry get​(String key)
        Description copied from interface: Attributes
        Get the collection of values for the given key. The result may implement Attributes.SetEntry if the values are distinct (for example, a role or group set).
        Specified by:
        get in interface Attributes
        Parameters:
        key - the attribute name
        Returns:
        the (possibly empty) attribute value collection
      • get

        public String get​(String key,
                          int idx)
        Description copied from interface: Attributes
        Get the mapping for the given key at the given position.
        Specified by:
        get in interface Attributes
        Parameters:
        key - the key
        idx - the index
        Returns:
        the mapping value
      • size

        public int size()
        Description copied from interface: Attributes
        Get the number of keys in this attribute collection.
        Specified by:
        size in interface Attributes
        Returns:
        the number of keys