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 ofAttributes
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
-
-
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 Attributes
aggregateOf(Attributes... aggrgatedAttributes)
Collection<Attributes.Entry>
entries()
Get the entry collection.Attributes.Entry
get(String key)
Get the collection of values for the given key.String
get(String key, int idx)
Get the mapping for the given key at the given position.int
size()
Get the number of keys in this attribute collection.int
size(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: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 interfaceAttributes
- 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 interfaceAttributes
- 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 implementAttributes.SetEntry
if the values are distinct (for example, a role or group set).- Specified by:
get
in 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:Attributes
Get the mapping for the given key at the given position.- Specified by:
get
in interfaceAttributes
- Parameters:
key
- the keyidx
- 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 interfaceAttributes
- Returns:
- the number of keys
-
-