public interface BlueKey extends java.io.Serializable, java.lang.Comparable<BlueKey>
BlueCollection or BlueIndex.TimeKey, TimeFrameKey, UUIDKey, StringKey, LongKey, IntegerKey| Modifier and Type | Field and Description |
|---|---|
static java.util.Comparator<java.lang.Object> |
nullSafeClassComparator |
| Modifier and Type | Method and Description |
|---|---|
default int |
compareCanonicalClassNames(BlueKey other)
Compares the canonical class name so that two keys of different types can be ordered consistently
|
static int |
compareCanonicalClassNames(java.lang.Object first,
java.lang.Object second)
Compares the canonical class name so that two keys of different types can be ordered consistently
|
default int |
compareTo(BlueKey other) |
static <T extends java.lang.Comparable<T>> |
compareWithNullsLast(T item1,
T item2)
Compares the the values in a null-safe way
|
boolean |
equals(java.lang.Object object) |
long |
getGroupingNumber()
Returns the grouping number which helps to determine the order and location of the key/value pairs on disk
|
default java.lang.Integer |
getIntegerIdIfPresent()
Convenience method to get the underlying Integer value if this is a IntegerKey
|
default java.lang.Long |
getLongIdIfPresent()
Convenience method to get the underlying Long value if this is a LongKey
|
int |
hashCode() |
default boolean |
isInRange(long min,
long max)
Returns true if this key's grouping number is in the range [min, max] inclusive, else false
|
int |
postGroupingNumberCompareTo(BlueKey other)
This is used to order the key/value pairs on disk.
|
static int |
unsafeCompareCanonicalClassNames(java.lang.Object first,
java.lang.Object second)
Compares the canonical class name so that two keys of different types can be ordered consistently
|
static final java.util.Comparator<java.lang.Object> nullSafeClassComparator
int hashCode()
hashCode in class java.lang.Objectboolean equals(java.lang.Object object)
equals in class java.lang.Objectdefault int compareTo(BlueKey other)
compareTo in interface java.lang.Comparable<BlueKey>int postGroupingNumberCompareTo(BlueKey other)
long getGroupingNumber()
default java.lang.Long getLongIdIfPresent()
default java.lang.Integer getIntegerIdIfPresent()
default boolean isInRange(long min,
long max)
min - the minimum grouping numbermax - the maximum grouping numberdefault int compareCanonicalClassNames(BlueKey other)
other - the key that this is being compared againststatic int compareCanonicalClassNames(java.lang.Object first,
java.lang.Object second)
first - the key to compare against secondsecond - the key to compare against firststatic int unsafeCompareCanonicalClassNames(java.lang.Object first,
java.lang.Object second)
first - key to compare against secondsecond - key to compare against firststatic <T extends java.lang.Comparable<T>> int compareWithNullsLast(T item1,
T item2)
T - Any type that you want to compareitem1 - value to compare against item2item2 - value to compare against item1