public class ObjectStrategyComplexTypeStrategy<T> extends Object implements TypeStrategy<T>
TypeStrategy for all ComplexMetricSerde
implementations that just wraps the ObjectStrategy they are required to implement.
This is not likely to be the most efficient way to do things, especially since writing must first produce a byte
array before it can be written to the buffer, but it is cheap and should work correctly, which is important.| Constructor and Description |
|---|
ObjectStrategyComplexTypeStrategy(ObjectStrategy<T> objectStrategy,
TypeSignature<?> signature) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(T o1,
T o2) |
int |
estimateSizeBytes(T value) |
T |
fromBytes(byte[] value) |
T |
read(ByteBuffer buffer) |
boolean |
readRetainsBufferReference() |
int |
write(ByteBuffer buffer,
T value,
int maxSizeBytes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, writecomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic ObjectStrategyComplexTypeStrategy(ObjectStrategy<T> objectStrategy, TypeSignature<?> signature)
public int estimateSizeBytes(@Nullable T value)
estimateSizeBytes in interface TypeStrategy<T>public T read(ByteBuffer buffer)
read in interface TypeStrategy<T>public boolean readRetainsBufferReference()
readRetainsBufferReference in interface TypeStrategy<T>public int write(ByteBuffer buffer, T value, int maxSizeBytes)
write in interface TypeStrategy<T>public int compare(T o1, T o2)
compare in interface Comparator<T>public T fromBytes(byte[] value)
fromBytes in interface TypeStrategy<T>Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.