Package org.wildfly.security.authz
Class AggregateAttributes
- java.lang.Object
-
- org.wildfly.security.authz.AggregateAttributes
-
- All Implemented Interfaces:
Attributes
public class AggregateAttributes extends Object implements Attributes
An implementation ofAttributesaggregating 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.wildfly.security.authz.Attributes
Attributes.Entry, Attributes.SetEntry
-
-
Field Summary
-
Fields inherited from interface org.wildfly.security.authz.Attributes
EMPTY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AttributesaggregateOf(Attributes... aggrgatedAttributes)Collection<Attributes.Entry>entries()Get the entry collection.Attributes.Entryget(String key)Get the collection of values for the given key.Stringget(String key, int idx)Get the mapping for the given key at the given position.intsize()Get the number of keys in this attribute collection.intsize(String key)Get the number of values mapped to the given key.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wildfly.security.authz.Attributes
add, addAll, addAll, addFirst, addLast, asReadOnly, clear, containsKey, containsValue, copyAndRemove, copyAndReplace, getFirst, getLast, indexOf, isEmpty, keySet, lastIndexOf, remove, remove, remove, removeAll, removeFirst, removeFirst, removeLast, removeLast, removeRange, set, set, values
-
-
-
-
Method Detail
-
aggregateOf
public static Attributes aggregateOf(Attributes... aggrgatedAttributes)
-
entries
public Collection<Attributes.Entry> entries()
Description copied from interface:AttributesGet 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:
entriesin interfaceAttributes- Returns:
- the entry collection
-
size
public int size(String key)
Description copied from interface:AttributesGet the number of values mapped to the given key.- Specified by:
sizein interfaceAttributes- Parameters:
key- the key- Returns:
- the number of mapped values
-
get
public Attributes.Entry get(String key)
Description copied from interface:AttributesGet the collection of values for the given key. The result may implementAttributes.SetEntryif the values are distinct (for example, a role or group set).- Specified by:
getin interfaceAttributes- Parameters:
key- the attribute name- Returns:
- the (possibly empty) attribute value collection
-
get
public String get(String key, int idx)
Description copied from interface:AttributesGet the mapping for the given key at the given position.- Specified by:
getin interfaceAttributes- Parameters:
key- the keyidx- the index- Returns:
- the mapping value
-
size
public int size()
Description copied from interface:AttributesGet the number of keys in this attribute collection.- Specified by:
sizein interfaceAttributes- Returns:
- the number of keys
-
-