public interface ObjectStrategy<T> extends Comparator<T>
| Modifier and Type | Method and Description |
|---|---|
default boolean |
canCompare()
Whether
Comparator.compare(T, T) is valid or not. |
T |
fromByteBuffer(ByteBuffer buffer,
int numBytes)
Convert values from their underlying byte representation.
|
default T |
fromByteBufferSafe(ByteBuffer buffer,
int numBytes)
Convert values from their underlying byte representation, when the underlying bytes might be corrupted or
maliciously constructed
Implementations of this method absolutely must never perform any sun.misc.Unsafe based memory read or write
operations from instructions contained in the data read from this buffer without first validating the data.
|
default T |
fromByteBufferWithSize(ByteBuffer buffer)
Reads 4-bytes numBytes from the given buffer, and then delegates to
fromByteBuffer(ByteBuffer, int). |
Class<? extends T> |
getClazz() |
byte[] |
toBytes(T val) |
default void |
writeTo(T val,
WriteOutBytes out) |
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong@Nullable T fromByteBuffer(ByteBuffer buffer, int numBytes)
ByteBuffer.slice(), ByteBuffer.asReadOnlyBuffer() or ByteBuffer.duplicate() in
this case.buffer - buffer to read value fromnumBytes - number of bytes used to store the value, starting at buffer.position()default boolean canCompare()
Comparator.compare(T, T) is valid or not.default T fromByteBufferWithSize(ByteBuffer buffer)
fromByteBuffer(ByteBuffer, int).default void writeTo(T val, WriteOutBytes out) throws IOException
IOException@Nullable default T fromByteBufferSafe(ByteBuffer buffer, int numBytes)
ByteBuffer methods, or using SafeWritableMemory if
Memory is employed to materialize the value.
Implementations of this method may change the given buffer's mark, or limit, and position.
Implementations of this method may not store the given buffer in a field of the "deserialized" object,
need to use ByteBuffer.slice(), ByteBuffer.asReadOnlyBuffer() or ByteBuffer.duplicate() in
this case.buffer - buffer to read value fromnumBytes - number of bytes used to store the value, starting at buffer.position()Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.