Class LinkedAttribute

All Implemented Interfaces:
Iterable<ByteString>, Collection<ByteString>, Set<ByteString>, Attribute

public final class LinkedAttribute extends AbstractAttribute
An implementation of the Attribute interface with predictable iteration order.

Internally, attribute values are stored in a linked list and it's this list which defines the iteration ordering, which is the order in which elements were inserted into the set (insertion-order). This ordering is particularly useful in LDAP where clients generally appreciate having things returned in the same order they were presented.

All operations are supported by this implementation.

  • Field Details

    • FACTORY

      public static final AttributeFactory FACTORY
      An attribute factory which can be used to create new linked attributes.
  • Constructor Details

    • LinkedAttribute

      public LinkedAttribute(Attribute attribute)
      Creates a new attribute having the same attribute description and attribute values as attribute.
      Parameters:
      attribute - The attribute to be copied.
      Throws:
      NullPointerException - If attribute was null.
    • LinkedAttribute

      public LinkedAttribute(AttributeDescription attributeDescription)
      Creates a new attribute having the specified attribute description and no attribute values.
      Parameters:
      attributeDescription - The attribute description.
      Throws:
      NullPointerException - If attributeDescription was null.
    • LinkedAttribute

      public LinkedAttribute(AttributeDescription attributeDescription, Object value)
      Creates a new attribute having the specified attribute description and single attribute value.

      If value is not an instance of ByteString then it will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      attributeDescription - The attribute description.
      value - The single attribute value.
      Throws:
      NullPointerException - If attributeDescription or value was null .
    • LinkedAttribute

      public LinkedAttribute(AttributeDescription attributeDescription, Object... values)
      Creates a new attribute having the specified attribute description and attribute values.

      Any attribute values which are not instances of ByteString will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      attributeDescription - The attribute description.
      values - The attribute values.
      Throws:
      NullPointerException - If attributeDescription or values was null.
    • LinkedAttribute

      public LinkedAttribute(AttributeDescription attributeDescription, Collection<?> values)
      Creates a new attribute having the specified attribute description and attribute values.

      Any attribute values which are not instances of ByteString will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      attributeDescription - The attribute description.
      values - The attribute values.
      Throws:
      NullPointerException - If attributeDescription or values was null.
    • LinkedAttribute

      public LinkedAttribute(String attributeDescription)
      Creates a new attribute having the specified attribute description and no attribute values. The attribute description will be decoded using the default schema.
      Parameters:
      attributeDescription - The attribute description.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If attributeDescription could not be decoded using the default schema.
      NullPointerException - If attributeDescription was null.
    • LinkedAttribute

      public LinkedAttribute(String attributeDescription, Collection<?> values)
      Creates a new attribute having the specified attribute description and attribute values. The attribute description will be decoded using the default schema.

      Any attribute values which are not instances of ByteString will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      attributeDescription - The attribute description.
      values - The attribute values.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If attributeDescription could not be decoded using the default schema.
      NullPointerException - If attributeDescription or values was null.
    • LinkedAttribute

      public LinkedAttribute(String attributeDescription, Object value)
      Creates a new attribute having the specified attribute description and single attribute value. The attribute description will be decoded using the default schema.

      If value is not an instance of ByteString then it will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      attributeDescription - The attribute description.
      value - The single attribute value.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If attributeDescription could not be decoded using the default schema.
      NullPointerException - If attributeDescription or value was null .
    • LinkedAttribute

      public LinkedAttribute(String attributeDescription, Object... values)
      Creates a new attribute having the specified attribute description and attribute values. The attribute description will be decoded using the default schema.

      Any attribute values which are not instances of ByteString will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      attributeDescription - The attribute description.
      values - The attribute values.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If attributeDescription could not be decoded using the default schema.
      NullPointerException - If attributeDescription or values was null.
  • Method Details