@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class RDN extends Object implements Comparable<RDN>
Constructor and Description |
---|
RDN(AttributeType[] attributeTypes,
String[] attributeNames,
org.forgerock.opendj.ldap.ByteString[] attributeValues)
Creates a new RDN with the provided information.
|
RDN(AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString attributeValue)
Creates a new RDN with the provided information.
|
RDN(AttributeType attributeType,
String attributeName,
org.forgerock.opendj.ldap.ByteString attributeValue)
Creates a new RDN with the provided information.
|
RDN(List<AttributeType> attributeTypes,
List<String> attributeNames,
List<org.forgerock.opendj.ldap.ByteString> attributeValues)
Creates a new RDN with the provided information.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(RDN rdn)
Compares this RDN with the provided RDN based on natural ordering defined
by the toNormalizedByteString() method.
|
static RDN |
create(AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString attributeValue)
Creates a new RDN with the provided information.
|
static RDN |
decode(String rdnString)
Decodes the provided string as an RDN.
|
RDN |
duplicate()
Creates a duplicate of this RDN that can be modified without
impacting this RDN.
|
boolean |
equals(Object o)
Indicates whether the provided object is equal to this RDN.
|
String |
getAttributeName(int pos)
Retrieves the name for the attribute type at the specified
position in the set of attribute types for this RDN.
|
AttributeType |
getAttributeType(int pos)
Retrieves the attribute type at the specified position in the set
of attribute types for this RDN.
|
org.forgerock.opendj.ldap.ByteString |
getAttributeValue(AttributeType attributeType)
Retrieves the attribute value that is associated with the
specified attribute type.
|
org.forgerock.opendj.ldap.ByteString |
getAttributeValue(int pos)
Retrieves the value for the attribute type at the specified
position in the set of attribute types for this RDN.
|
int |
getNumValues()
Retrieves the number of attribute-value pairs contained in this
RDN.
|
boolean |
hasAttributeType(AttributeType attributeType)
Indicates whether this RDN includes the specified attribute type.
|
boolean |
hasAttributeType(String lowerName)
Indicates whether this RDN includes the specified attribute type.
|
int |
hashCode()
Retrieves the hash code for this RDN.
|
boolean |
hasValue(AttributeType type,
org.forgerock.opendj.ldap.ByteString value)
Indicates whether this RDN contains the specified type-value
pair.
|
boolean |
isMultiValued()
Indicates whether this RDN is multivalued.
|
org.forgerock.opendj.ldap.ByteStringBuilder |
toNormalizedByteString(org.forgerock.opendj.ldap.ByteStringBuilder builder)
Adds a normalized byte string representation of this RDN to the provided builder.
|
String |
toString()
Retrieves a string representation of this RDN.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this RDN to the provided
buffer.
|
public RDN(AttributeType attributeType, org.forgerock.opendj.ldap.ByteString attributeValue)
attributeType
- The attribute type for this RDN. It must
not be null
.attributeValue
- The value for this RDN. It must not be
null
.public RDN(AttributeType attributeType, String attributeName, org.forgerock.opendj.ldap.ByteString attributeValue)
attributeType
- The attribute type for this RDN. It must
not be null
.attributeName
- The user-provided name for this RDN. It
must not be null
.attributeValue
- The value for this RDN. It must not be
null
.public RDN(List<AttributeType> attributeTypes, List<String> attributeNames, List<org.forgerock.opendj.ldap.ByteString> attributeValues)
attributeTypes
- The set of attribute types for this RDN.
It must not be empty or null
.attributeNames
- The set of user-provided names for this
RDN. It must have the same number of
elements as the attributeTypes
argument.attributeValues
- The set of values for this RDN. It must
have the same number of elements as the
attributeTypes
argument.public RDN(AttributeType[] attributeTypes, String[] attributeNames, org.forgerock.opendj.ldap.ByteString[] attributeValues)
attributeTypes
- The set of attribute types for this RDN.
It must not be empty or null
.attributeNames
- The set of user-provided names for this
RDN. It must have the same number of
elements as the attributeTypes
argument.attributeValues
- The set of values for this RDN. It must
have the same number of elements as the
attributeTypes
argument.public static RDN create(AttributeType attributeType, org.forgerock.opendj.ldap.ByteString attributeValue)
attributeType
- The attribute type for this RDN. It must
not be null
.attributeValue
- The value for this RDN. It must not be
null
.public int getNumValues()
public boolean hasAttributeType(AttributeType attributeType)
attributeType
- The attribute type for which to make the
determination.true
if the RDN includes the specified
attribute type, or false
if not.public boolean hasAttributeType(String lowerName)
lowerName
- The name or OID for the attribute type for
which to make the determination, formatted in
all lowercase characters.true
if the RDN includes the specified
attribute type, or false
if not.public AttributeType getAttributeType(int pos)
pos
- The position of the attribute type to retrieve.public String getAttributeName(int pos)
pos
- The position of the attribute type for which to
retrieve the name.public org.forgerock.opendj.ldap.ByteString getAttributeValue(AttributeType attributeType)
attributeType
- The attribute type for which to retrieve
the corresponding value.null
if the specified attribute type is not
present in the RDN.public org.forgerock.opendj.ldap.ByteString getAttributeValue(int pos)
pos
- The position of the attribute type for which to
retrieve the value.public boolean isMultiValued()
true
if this RDN is multivalued, or
false
if not.public boolean hasValue(AttributeType type, org.forgerock.opendj.ldap.ByteString value)
type
- The attribute type for which to make the
determination.value
- The value for which to make the determination.true
if this RDN contains the specified
attribute value, or false
if not.public static RDN decode(String rdnString) throws DirectoryException
rdnString
- The string to decode as an RDN.DirectoryException
- If a problem occurs while trying to decode the provided
string as a RDN.public RDN duplicate()
public boolean equals(Object o)
public int hashCode()
public void toString(StringBuilder buffer)
buffer
- The buffer to which the string representation
should be appended.public org.forgerock.opendj.ldap.ByteStringBuilder toNormalizedByteString(org.forgerock.opendj.ldap.ByteStringBuilder builder)
The representation is suitable for equality and comparisons, and for providing a natural hierarchical ordering. However, it is not a valid RDN and can't be reverted to a valid RDN.
builder
- Builder to add this representation to.public int compareTo(RDN rdn)
compareTo
in interface Comparable<RDN>
rdn
- The RDN against which to compare this RDN.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.