public final class Attributes extends Object
Modifier and Type | Method and Description |
---|---|
static Attribute |
emptyAttribute(AttributeDescription attributeDescription)
Returns a read-only empty attribute having the specified attribute
description.
|
static Attribute |
emptyAttribute(String attributeDescription)
Returns a read-only empty attribute having the specified attribute
description.
|
static Attribute |
renameAttribute(Attribute attribute,
AttributeDescription attributeDescription)
Returns a view of
attribute having a different attribute
description. |
static Attribute |
renameAttribute(Attribute attribute,
String attributeDescription)
Returns a view of
attribute having a different attribute
description. |
static Attribute |
singletonAttribute(AttributeDescription attributeDescription,
Object value)
Returns a read-only single-valued attribute having the specified
attribute description and value.
|
static Attribute |
singletonAttribute(String attributeDescription,
Object value)
Returns a read-only single-valued attribute having the specified
attribute description.
|
static Attribute |
unmodifiableAttribute(Attribute attribute)
Returns a read-only view of
attribute . |
public static Attribute emptyAttribute(AttributeDescription attributeDescription)
UnsupportedOperationException
.attributeDescription
- The attribute description.NullPointerException
- If attributeDescription
was null
.public static Attribute emptyAttribute(String attributeDescription)
UnsupportedOperationException
.attributeDescription
- The attribute description.LocalizedIllegalArgumentException
- If attributeDescription
could not be decoded using
the default schema.NullPointerException
- If attributeDescription
was null
.public static Attribute renameAttribute(Attribute attribute, AttributeDescription attributeDescription)
attribute
having a different attribute
description. All operations on the returned attribute "pass-through" to
the underlying attribute.attribute
- The attribute to be renamed.attributeDescription
- The new attribute description for attribute
.attribute
.NullPointerException
- If attribute
or attributeDescription
was
null
.public static Attribute renameAttribute(Attribute attribute, String attributeDescription)
attribute
having a different attribute
description. All operations on the returned attribute "pass-through" to
the underlying attribute. The attribute description will be decoded using
the default schema.attribute
- The attribute to be renamed.attributeDescription
- The new attribute description for attribute
.attribute
.LocalizedIllegalArgumentException
- If attributeDescription
could not be decoded using
the default schema.NullPointerException
- If attribute
or attributeDescription
was
null
.public static Attribute singletonAttribute(AttributeDescription attributeDescription, Object value)
UnsupportedOperationException
.
If value
is not an instance of ByteString
then it will be
converted using the ByteString.valueOfObject(Object)
method.
attributeDescription
- The attribute description.value
- The single attribute value.NullPointerException
- If attributeDescription
or value
was
null
.public static Attribute singletonAttribute(String attributeDescription, Object value)
UnsupportedOperationException
.
If value
is not an instance of ByteString
then it will be
converted using the ByteString.valueOfObject(Object)
method.
attributeDescription
- The attribute description.value
- The single attribute value.LocalizedIllegalArgumentException
- If attributeDescription
could not be decoded using
the default schema.NullPointerException
- If attributeDescription
or value
was
null
.public static Attribute unmodifiableAttribute(Attribute attribute)
attribute
. Query operations on the
returned attribute "read-through" to the underlying attribute, and
attempts to modify the returned attribute either directly or indirectly
via an iterator result in an UnsupportedOperationException
.attribute
- The attribute for which a read-only view is to be returned.attribute
.NullPointerException
- If attribute
was null
.Copyright 2010-2020 ForgeRock AS.