Class SortKey
- java.lang.Object
-
- org.identityconnectors.framework.common.objects.SortKey
-
public final class SortKey extends Object
A sort key which can be used to specify the order in which connector objects should be included in the results of a search request.- Since:
- 1.4
- Author:
- Laszlo Hordos
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SortKey
ascendingOrder(String field)
Creates a new ascending-order sort key for the provided field.static SortKey
descendingOrder(String field)
Creates a new descending-order sort key for the provided field.String
getField()
Returns the sort key field.boolean
isAscendingOrder()
Returnstrue
if this sort key is in ascending order, orfalse
if it is in descending order.static SortKey
reverseOrder(SortKey key)
Creates a new sort key having the same field as the provided key, but in reverse sort order.String
toString()
Returns the string representation of this sort key.
-
-
-
Constructor Detail
-
SortKey
public SortKey(String field, boolean isAscendingOrder)
-
-
Method Detail
-
ascendingOrder
public static SortKey ascendingOrder(String field)
Creates a new ascending-order sort key for the provided field.- Parameters:
field
- The sort key field.- Returns:
- A new ascending-order sort key.
- Throws:
IllegalArgumentException
- Iffield
is not a valid attribute name.
-
descendingOrder
public static SortKey descendingOrder(String field)
Creates a new descending-order sort key for the provided field.- Parameters:
field
- The sort key field.- Returns:
- A new descending-order sort key.
- Throws:
IllegalArgumentException
- Iffield
is not a valid attribute name.
-
reverseOrder
public static SortKey reverseOrder(SortKey key)
Creates a new sort key having the same field as the provided key, but in reverse sort order.- Parameters:
key
- The sort key to be reversed.- Returns:
- The reversed sort key.
-
getField
public String getField()
Returns the sort key field.- Returns:
- The sort key field.
-
isAscendingOrder
public boolean isAscendingOrder()
Returnstrue
if this sort key is in ascending order, orfalse
if it is in descending order.- Returns:
true
if this sort key is in ascending order, orfalse
if it is in descending ord)er.
-
toString
public String toString()
Returns the string representation of this sort key. It will be composed of a plus symbol, if the key is ascending, or a minus symbol, if the key is descending, followed by the field name.
-
-