AV
- element type (primitive). Indeed, XACML spec says for Attribute Bags (7.3.2): "There SHALL be no notion of a bag containing bags, or a bag containing values of differing types; i.e., a
bag in XACML SHALL contain only values that are of the same data-type."public final class MutableAttributeBag<AV extends AttributeValue> extends Object implements Iterable<AV>
To be instantiated only in a given evaluation request context (handled by a single thread), otherwise not guaranteed thread-safe.
Constructor and Description |
---|
MutableAttributeBag(Datatype<AV> elementDatatype,
AttributeSource attributeSource) |
Modifier and Type | Method and Description |
---|---|
void |
add(AV value)
Adds value to bag
|
void |
addAll(Collection<? extends AttributeValue> list)
Appends all of the elements in the specified collection to the end of this bag, in the order that they are returned by the specified collection's iterator (optional operation).
|
AV |
addRaw(AttributeValue value)
Adds value to bag
|
Datatype<AV> |
getElementType()
Returns bag element datatype
|
Iterator<AV> |
iterator() |
AttributeBag<AV> |
toImmutable()
Lock the bag and return the immutable copy of this bag
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public MutableAttributeBag(Datatype<AV> elementDatatype, AttributeSource attributeSource) throws IllegalArgumentException
elementDatatype
- primitive datatype factory to create every element/value in the bagattributeSource
- attribute bag sourceIllegalArgumentException
- iff elementDatatypeFactory == null || attributeSource == null
public Datatype<AV> getElementType()
public void add(AV value)
value
- attribute valueIllegalArgumentException
- if value == null
public AV addRaw(AttributeValue value) throws IllegalArgumentException
value
- AttributeValue from a XACML Attribute elementIllegalArgumentException
- if value == null
or if the datatype of value
is different from other(s) in the attribute bagpublic AttributeBag<AV> toImmutable()
public void addAll(Collection<? extends AttributeValue> list) throws IllegalArgumentException, ClassCastException
list
- collection containing elements to be added to this listIllegalArgumentException
- if list
is nullClassCastException
- if one of the values in list
is not assignable to the type AV
Copyright © 2012–2020. All rights reserved.