@Private
@Unstable
public class GenericObjectMapper
extends java.lang.Object
write(Object) and read(byte[]) methods are
used by the LeveldbTimelineStore to store and retrieve arbitrary
JSON, while the writeReverseOrderedLong(long) and readReverseOrderedLong(byte[], int) methods are used to sort entities in descending
start time order.| Modifier and Type | Field | Description |
|---|---|---|
static com.fasterxml.jackson.databind.ObjectReader |
OBJECT_READER |
|
static com.fasterxml.jackson.databind.ObjectWriter |
OBJECT_WRITER |
| Constructor | Description |
|---|---|
GenericObjectMapper() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.Object |
read(byte[] b) |
Deserializes an Object from a byte array created with
write(Object). |
static java.lang.Object |
read(byte[] b,
int offset) |
Deserializes an Object from a byte array at a specified offset, assuming
the bytes were created with
write(Object). |
static long |
readReverseOrderedLong(byte[] b,
int offset) |
Reads 8 bytes from an array starting at the specified offset and
converts them to a long.
|
static byte[] |
write(java.lang.Object o) |
Serializes an Object into a byte array.
|
static byte[] |
writeReverseOrderedLong(long l) |
Converts a long to a 8-byte array so that lexicographic ordering of the
produced byte arrays sort the longs in descending order.
|
static byte[] |
writeReverseOrderedLong(long l,
byte[] b,
int offset) |
public static final com.fasterxml.jackson.databind.ObjectReader OBJECT_READER
public static final com.fasterxml.jackson.databind.ObjectWriter OBJECT_WRITER
public static byte[] write(java.lang.Object o)
throws java.io.IOException
read(byte[]),
can be used to serialize an Object and deserialize it into an Object of
the same type without needing to specify the Object's type,
as long as it is one of the JSON-compatible objects understood by
ObjectMapper.o - An Objectjava.io.IOException - if there is a write errorpublic static java.lang.Object read(byte[] b)
throws java.io.IOException
write(Object).b - A byte arrayjava.io.IOException - if there is a read errorpublic static java.lang.Object read(byte[] b,
int offset)
throws java.io.IOException
write(Object).b - A byte arrayoffset - Offset into the arrayjava.io.IOException - if there is a read errorpublic static byte[] writeReverseOrderedLong(long l)
l - A longpublic static byte[] writeReverseOrderedLong(long l,
byte[] b,
int offset)
public static long readReverseOrderedLong(byte[] b,
int offset)
writeReverseOrderedLong(long).b - A byte arrayoffset - An offset into the byte arrayCopyright © 2008–2025 Apache Software Foundation. All rights reserved.