Package com.usatiuk.objects
Interface JObjectKey
- All Superinterfaces:
Comparable<JObjectKey>,Serializable
- All Known Implementing Classes:
JObjectKeyImpl,JObjectKeyMax,JObjectKeyMin
public sealed interface JObjectKey
extends Serializable, Comparable<JObjectKey>
permits JObjectKeyImpl, JObjectKeyMax, JObjectKeyMin
JObjectKey is an interface for object keys to be used in the object store.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintstatic JObjectKeyfirst()Returns a JObjectKey that compares less than all other keys.static JObjectKeyfromByteBuffer(ByteBuffer buff) Creates a new JObjectKey from a ByteBuffer.static JObjectKeyfromBytes(byte[] bytes) Creates a new JObjectKey from a byte array.static JObjectKeylast()Returns a JObjectKey that compares greater than all other keys.static JObjectKeyCreates a new JObjectKey from a string value.static JObjectKeyrandom()Creates a new JObjectKey with a random UUID.Returns the byte buffer representation of the key.toString()value()Returns the string value of the key.
-
Field Details
-
MIN
-
MAX
-
-
Method Details
-
of
Creates a new JObjectKey from a string value.- Parameters:
value- the string value of the key- Returns:
- a new JObjectKey
-
random
Creates a new JObjectKey with a random UUID.- Returns:
- a new JObjectKey with a random UUID
-
first
Returns a JObjectKey that compares less than all other keys. Calling value on this key will result in an exception.- Returns:
- a JObjectKey that compares less than all other keys
-
last
Returns a JObjectKey that compares greater than all other keys. Calling value on this key will result in an exception.- Returns:
- a JObjectKey that compares greater than all other keys
-
fromBytes
Creates a new JObjectKey from a byte array.- Parameters:
bytes- the byte array representing the key- Returns:
- a new JObjectKey
-
fromByteBuffer
Creates a new JObjectKey from a ByteBuffer.- Parameters:
buff- the ByteBuffer representing the key- Returns:
- a new JObjectKey
-
compareTo
- Specified by:
compareToin interfaceComparable<JObjectKey>
-
toString
String toString() -
toByteBuffer
ByteBuffer toByteBuffer()Returns the byte buffer representation of the key.- Returns:
- the byte buffer representation of the key
-
value
String value()Returns the string value of the key.- Returns:
- the string value of the key
-