public class BagAttribute extends AttributeValue
NOTE: This is the one standard attribute type that can't be created from the factory, since you can't have this in an XML block (it is used only in return values & dynamic inputs). I think this is right, but we may need to add some functionality to let this go into the factory.
Constructor and Description |
---|
BagAttribute(URI type,
Collection bag)
Creates a new
BagAttribute that represents
the Collection of AttributeValue s supplied. |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(AttributeValue value)
Returns true if this set contains the specified value.
|
boolean |
containsAll(BagAttribute bag)
Returns true if this bag contains all of the values of the specified bag.
|
static BagAttribute |
createEmptyBag(URI type)
Convenience function that returns a bag with no elements
|
String |
encode()
Because a bag cannot be included in a request/response or a
policy, this will always throw an
UnsupportedOperationException . |
Object |
getValue()
Get the value represented
|
boolean |
isBag()
Overrides the default method to always return true.
|
boolean |
isEmpty()
A convenience function that returns whether or not the bag is empty
(ie, whether or not the size of the bag is zero)
|
Iterator |
iterator()
Returns an iterator over te
|
int |
size()
Returns the number of elements in this bag
|
encode, encode, encodeWithTags, evaluate, evaluatesToBag, getChildren, getType, returnsBag
public BagAttribute(URI type, Collection bag)
BagAttribute
that represents
the Collection
of AttributeValue
s supplied.
If the set is null or empty, then the new bag is empty.type
- the data type of all the attributes in the setbag
- a Collection
of AttributeValue
spublic boolean isBag()
isBag
in class AttributeValue
public static BagAttribute createEmptyBag(URI type)
type
- the types contained in the bagpublic boolean isEmpty()
public int size()
public boolean contains(AttributeValue value)
AttributeValue
has overridden the
equals
method.value
- the value to look forpublic boolean containsAll(BagAttribute bag)
AttributeValue
type contained in the bag has overridden
the equals
method.bag
- the bag to comparepublic Iterator iterator()
public String encode()
UnsupportedOperationException
.encode
in class AttributeValue
String
form of the valuepublic Object getValue()
AttributeValue
getValue
in class AttributeValue
Copyright © 2023 JBoss by Red Hat. All rights reserved.