Class LDAPAttribute


  • public class LDAPAttribute
    extends RawAttribute
    This class defines the data structures and methods to use when interacting with an LDAP attribute, which is the basic unit of information in an LDAP entry.
    • Constructor Detail

      • LDAPAttribute

        public LDAPAttribute​(String attributeType)
        Creates a new LDAP attribute with the provided type and no values.
        Parameters:
        attributeType - The attribute type for this attribute.
      • LDAPAttribute

        public LDAPAttribute​(String attributeType,
                             String value)
        Creates a new LDAP attribute with the provided type and no values.
        Parameters:
        attributeType - The attribute type for this attribute.
        value - The value to use for this attribute.
      • LDAPAttribute

        public LDAPAttribute​(String attributeType,
                             ByteString value)
        Creates a new LDAP attribute with the provided type and no values.
        Parameters:
        attributeType - The attribute type for this attribute.
        value - The value to use for this attribute.
      • LDAPAttribute

        public LDAPAttribute​(String attributeType,
                             List<String> values)
        Creates a new LDAP attribute with the provided type and values.
        Parameters:
        attributeType - The attribute type for this attribute.
        values - The set of values for this attribute.
      • LDAPAttribute

        public LDAPAttribute​(String attributeType,
                             ArrayList<ByteString> values)
        Creates a new LDAP attribute with the provided type and values.
        Parameters:
        attributeType - The attribute type for this attribute.
        values - The set of values for this attribute.
      • LDAPAttribute

        public LDAPAttribute​(Attribute attribute)
        Creates a new LDAP attribute from the provided attribute.
        Parameters:
        attribute - The attribute to use to create this LDAP attribute.
    • Method Detail

      • getAttributeType

        public String getAttributeType()
        Retrieves the attribute type for this attribute.
        Specified by:
        getAttributeType in class RawAttribute
        Returns:
        The attribute type for this attribute.
      • setAttributeType

        public void setAttributeType​(String attributeType)
        Specifies the attribute type for this attribute.
        Specified by:
        setAttributeType in class RawAttribute
        Parameters:
        attributeType - The attribute type for this attribute.
      • getValues

        public List<ByteString> getValues()
        Retrieves the set of values for this attribute. The returned list may be modified by the caller.
        Specified by:
        getValues in class RawAttribute
        Returns:
        The set of values for this attribute.
      • toAttribute

        public Attribute toAttribute()
                              throws LDAPException
        Retrieves a core attribute containing the information for this LDAP attribute.
        Specified by:
        toAttribute in class RawAttribute
        Returns:
        A core attribute containing the information for this LDAP attribute.
        Throws:
        LDAPException - If the provided value is invalid according to the attribute syntax.
      • toString

        public String toString()
        Retrieves a string representation of this attribute.
        Overrides:
        toString in class RawAttribute
        Returns:
        A string representation of this attribute.
      • toString

        public void toString​(StringBuilder buffer)
        Appends a string representation of this attribute to the provided buffer.
        Specified by:
        toString in class RawAttribute
        Parameters:
        buffer - The buffer to which the information should be appended.
      • toString

        public void toString​(StringBuilder buffer,
                             int indent)
        Appends a multi-line string representation of this LDAP attribute to the provided buffer.
        Specified by:
        toString in class RawAttribute
        Parameters:
        buffer - The buffer to which the information should be appended.
        indent - The number of spaces from the margin that the lines should be indented.