public abstract class ComparableBinding
extends java.lang.Object
Java objects as ByteIterable. There are several
inheritors of the ComparableBinding class, they allow to serialize a value of any Java primitive type or
String to ArrayByteIterable, as well as to deserialize ByteIterable to a value.
All the inheritors contain two static methods: one for getting ByteIterable entry from a value,
and another for getting value from a ByteIterable entry.
Bindings save natural order of values. This means that the greater the value, the greater the ByteIterable
entry. The order of the ByteIterable entries is defined by
ByteIterableUtil.compare(ByteIterable, ByteIterable). The only exceptions are DoubleBinding
and FloatBinding, they save order only for unsigned non-negative values.
| Constructor and Description |
|---|
ComparableBinding() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Comparable |
entryToObject(@NotNull ByteIterable entry) |
ArrayByteIterable |
objectToEntry(@NotNull java.lang.Comparable object) |
abstract java.lang.Comparable |
readObject(@NotNull java.io.ByteArrayInputStream stream) |
abstract void |
writeObject(@NotNull LightOutputStream output,
@NotNull java.lang.Comparable object) |
public final java.lang.Comparable entryToObject(@NotNull
@NotNull ByteIterable entry)
public final ArrayByteIterable objectToEntry(@NotNull @NotNull java.lang.Comparable object)
public abstract java.lang.Comparable readObject(@NotNull
@NotNull java.io.ByteArrayInputStream stream)
public abstract void writeObject(@NotNull
@NotNull LightOutputStream output,
@NotNull
@NotNull java.lang.Comparable object)