@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class RDNNameValuePair extends java.lang.Object implements java.lang.Comparable<RDNNameValuePair>, java.util.Comparator<RDNNameValuePair>, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
int |
compare(RDNNameValuePair p1,
RDNNameValuePair p2)
Retrieves an integer value that represents the order in which the provided
RDN name-value pairs should be placed in a sorted list.
|
int |
compareTo(RDNNameValuePair p)
Retrieves an integer value that represents the order in which this RDN
name-value pair should be placed in relation to the provided RDN name-value
pair in a sorted list.
|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is considered logically equivalent to
this RDN name-value pair.
|
java.lang.String |
getAttributeName()
Retrieves the attribute name for this name-value pair.
|
java.lang.String |
getAttributeValue()
Retrieves the string representation of the attribute value for this
name-value pair.
|
byte[] |
getAttributeValueBytes()
Retrieves the bytes that comprise the attribute value for this name-value
pair.
|
java.lang.String |
getNormalizedAttributeName()
Retrieves a normalized representation of the attribute name.
|
ASN1OctetString |
getRawAttributeValue()
Retrieves the raw attribute value for this name-value pair.
|
boolean |
hasAttributeName(java.lang.String name)
Indicates whether this RDN name-value pair has the provided attribute name
(or a name that is logically equivalent to it).
|
boolean |
hasAttributeValue(byte[] value)
Indicates whether this RDN name-value pair has the provided attribute value
(or a value that is logically equivalent to it).
|
boolean |
hasAttributeValue(java.lang.String value)
Indicates whether this RDN name-value pair has the provided attribute value
(or a value that is logically equivalent to it).
|
int |
hashCode()
Retrieves a hash code for this RDN name-value pair.
|
java.lang.String |
toMinimallyEncodedString()
Retrieves a string representation of this RDN name-value pair with minimal
encoding for special characters.
|
java.lang.String |
toNormalizedString()
Retrieves a normalized string representation of this RDN name-value pair.
|
void |
toNormalizedString(java.lang.StringBuilder buffer)
Appends a normalized string representation of this RDN name-value pair to
the provided buffer.
|
java.lang.String |
toString()
Retrieves a string representation of this RDN name-value pair.
|
void |
toString(ByteStringBuffer buffer,
DNEscapingStrategy escapingStrategy)
Appends a string representation of this RDN name-value pair to the provided
buffer.
|
void |
toString(java.lang.StringBuilder buffer,
boolean minimizeEncoding)
Appends a string representation of this RDN name-value pair to the provided
buffer.
|
@NotNull public java.lang.String getAttributeName()
@NotNull public java.lang.String getNormalizedAttributeName()
public boolean hasAttributeName(@NotNull java.lang.String name)
name
- The name for which to make the determination.true
if this name-value pair has the provided attribute
name (or a name that is logically equivalent to it), or
false
if not.@NotNull public java.lang.String getAttributeValue()
@NotNull public byte[] getAttributeValueBytes()
@NotNull public ASN1OctetString getRawAttributeValue()
public boolean hasAttributeValue(@NotNull java.lang.String value)
value
- The value for which to make the determination.true
if this RDN name-value pair has the provided
attribute value (or a value that is logically equivalent to it),
or false
if not.public boolean hasAttributeValue(@NotNull byte[] value)
value
- The value for which to make the determination.true
if this RDN name-value pair has the provided
attribute value (or a value that is logically equivalent to it),
or false
if not.public int compareTo(@NotNull RDNNameValuePair p)
compareTo
in interface java.lang.Comparable<RDNNameValuePair>
p
- The RDN name-value pair to be ordered relative to this RDN
name-value pair. It must not be null
.public int compare(@NotNull RDNNameValuePair p1, @NotNull RDNNameValuePair p2)
compare
in interface java.util.Comparator<RDNNameValuePair>
p1
- The first RDN name-value pair to compare. It must not be
null
.p2
- The second RDN name-value pair to compare. It must not be
null
.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object o)
equals
in interface java.util.Comparator<RDNNameValuePair>
equals
in class java.lang.Object
o
- The object for which to make the determination.true
if the provided object is an RDN name-value pair that
is logically equivalent to this RDN name-value pair, or
false
if not.@NotNull public java.lang.String toString()
toString
in class java.lang.Object
@NotNull public java.lang.String toMinimallyEncodedString()
public void toString(@NotNull java.lang.StringBuilder buffer, boolean minimizeEncoding)
buffer
- The buffer to which the string representation is
to be appended.minimizeEncoding
- Indicates whether to restrict the encoding of
special characters to the bare minimum required
by LDAP (as per RFC 4514 section 2.4). If this
is true
, then only leading and trailing
spaces, double quotes, plus signs, commas,
semicolons, greater-than, less-than, and
backslash characters will be encoded.public void toString(@NotNull ByteStringBuffer buffer, @NotNull DNEscapingStrategy escapingStrategy)
buffer
- The buffer to which the string representation is
to be appended. It must not be null
.escapingStrategy
- The strategy to use to determine which types of
optional escaping should be used for values. It
must not be null
.@NotNull public java.lang.String toNormalizedString()
public void toNormalizedString(@NotNull java.lang.StringBuilder buffer)
buffer
- The buffer to which the normalized string representation
should be appended. It must not be null
.