@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class SortKey extends java.lang.Object implements java.io.Serializable
ServerSideSortRequestControl
for
requesting that the server sort the results before returning them to the
client.
reverseOrder
flag that indicates whether the results should
be sorted in ascending order (if the value is false
) or
descending order (if the value is true
).Constructor and Description |
---|
SortKey(java.lang.String attributeName)
Creates a new sort key with the specified attribute name.
|
SortKey(java.lang.String attributeName,
boolean reverseOrder)
Creates a new sort key with the specified attribute name.
|
SortKey(java.lang.String attributeName,
java.lang.String matchingRuleID,
boolean reverseOrder)
Creates a new sort key with the provided information.
|
Modifier and Type | Method and Description |
---|---|
static SortKey |
decode(ASN1Element element)
Decodes the provided ASN.1 element as a sort key.
|
java.lang.String |
getAttributeName()
Retrieves the attribute name for this sort key.
|
java.lang.String |
getMatchingRuleID()
Retrieves the name or OID of the ordering matching rule that should be used
to perform the sort, if defined.
|
boolean |
reverseOrder()
Indicates whether the sort should be performed in reverse order.
|
java.lang.String |
toString()
Retrieves a string representation of this sort key.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this sort key to the provided buffer.
|
public SortKey(@NotNull java.lang.String attributeName)
attributeName
- The attribute name for this sort key. It must not
be null
.public SortKey(@NotNull java.lang.String attributeName, boolean reverseOrder)
attributeName
- The attribute name for this sort key. It must not
be null
.reverseOrder
- Indicates whether the sort should be performed in
reverse order.public SortKey(@NotNull java.lang.String attributeName, @Nullable java.lang.String matchingRuleID, boolean reverseOrder)
attributeName
- The attribute name for this sort key. It must not
be null
.matchingRuleID
- The name or OID of the ordering matching rule that
should be used to perform the sort. It may be
null
if the default ordering matching rule
for the specified attribute is to be used.reverseOrder
- Indicates whether the sort should be performed in
reverse order.@NotNull public java.lang.String getAttributeName()
@Nullable public java.lang.String getMatchingRuleID()
null
if the sort should use the
default ordering matching rule associated with the specified
attribute.public boolean reverseOrder()
true
if the sort should be performed in reverse order, or
false
if it should be performed in the standard order for
the associated ordering matching rule.@NotNull public static SortKey decode(@NotNull ASN1Element element) throws LDAPException
element
- The ASN.1 element to decode as a sort key.LDAPException
- If the provided ASN.1 element cannot be decoded as
a sort key.@NotNull public java.lang.String toString()
toString
in class java.lang.Object