Package org.opends.server.protocols.ldap
Class LDAPAttribute
- java.lang.Object
-
- org.opends.server.types.RawAttribute
-
- org.opends.server.protocols.ldap.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 Summary
Constructors Constructor Description LDAPAttribute(String attributeType)Creates a new LDAP attribute with the provided type and no values.LDAPAttribute(String attributeType, String value)Creates a new LDAP attribute with the provided type and no values.LDAPAttribute(String attributeType, ArrayList<ByteString> values)Creates a new LDAP attribute with the provided type and values.LDAPAttribute(String attributeType, List<String> values)Creates a new LDAP attribute with the provided type and values.LDAPAttribute(String attributeType, ByteString value)Creates a new LDAP attribute with the provided type and no values.LDAPAttribute(Attribute attribute)Creates a new LDAP attribute from the provided attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAttributeType()Retrieves the attribute type for this attribute.List<ByteString>getValues()Retrieves the set of values for this attribute.voidsetAttributeType(String attributeType)Specifies the attribute type for this attribute.AttributetoAttribute()Retrieves a core attribute containing the information for this LDAP attribute.StringtoString()Retrieves a string representation of this attribute.voidtoString(StringBuilder buffer)Appends a string representation of this attribute to the provided buffer.voidtoString(StringBuilder buffer, int indent)Appends a multi-line string representation of this LDAP attribute to the provided buffer.
-
-
-
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:
getAttributeTypein classRawAttribute- Returns:
- The attribute type for this attribute.
-
setAttributeType
public void setAttributeType(String attributeType)
Specifies the attribute type for this attribute.- Specified by:
setAttributeTypein classRawAttribute- 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:
getValuesin classRawAttribute- 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:
toAttributein classRawAttribute- 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:
toStringin classRawAttribute- 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:
toStringin classRawAttribute- 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:
toStringin classRawAttribute- 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.
-
-