public class SortKeyComparator extends Object implements Comparator<JsonValue>
null
object could be considered either
as the lowest possible value (SortKeyComparator.NullPosition.NULL_FIRST
, default) or the highest possible value
(SortKeyComparator.NullPosition.NULL_LAST
).Modifier and Type | Class and Description |
---|---|
static class |
SortKeyComparator.NullPosition
Defines possible positions for JsonValue that wraps a
null object. |
Constructor and Description |
---|
SortKeyComparator(List<SortKey> sortKeys)
Construct a Comparator that will compare two JsonValue objects based on the provided list of SortKeys.
|
SortKeyComparator(List<SortKey> sortKeys,
SortKeyComparator.NullPosition nullPosition)
Construct a Comparator that will compare two JsonValue objects based on the provided list of SortKeys and
options.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(JsonValue left,
JsonValue right) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public SortKeyComparator(List<SortKey> sortKeys)
sortKeys
- the sortKeys to utilize for sorting.public SortKeyComparator(List<SortKey> sortKeys, SortKeyComparator.NullPosition nullPosition)
sortKeys
- the sortKeys to utilize for sorting.nullPosition
- Whether a JsonValue that wraps a null
object should be considered less or more that one that
is not.SortKeyComparator.NullPosition
public int compare(JsonValue left, JsonValue right)
compare
in interface Comparator<JsonValue>
Copyright 2011-2017 ForgeRock AS.