public class PojoCodec extends AbstractKryoCodec
Serializer
s may be registered via
KryoRegistrar
s.pool
Constructor and Description |
---|
PojoCodec() |
PojoCodec(KryoRegistrar kryoRegistrar)
Create an instance with a single KryoRegistrar.
|
PojoCodec(KryoRegistrar kryoRegistrar,
boolean useReferences)
Create an instance with a single KryoRegistrar.
|
PojoCodec(List<KryoRegistrar> kryoRegistrars)
Create an instance with zero to many KryoRegistrars.
|
PojoCodec(List<KryoRegistrar> kryoRegistrars,
boolean useReferences)
Create an instance with zero to many KryoRegistrars.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configureKryoInstance(com.esotericsoftware.kryo.Kryo kryo)
Subclasses implement this to configure the kryo instance.
|
protected <T> T |
doDecode(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input input,
Class<T> type)
Subclasses implement this method to decode with Kryo.
|
protected void |
doEncode(com.esotericsoftware.kryo.Kryo kryo,
Object object,
com.esotericsoftware.kryo.io.Output output)
Subclasses implement this method to encode with Kryo.
|
decode, decode, encode, encode
public PojoCodec()
public PojoCodec(KryoRegistrar kryoRegistrar)
kryoRegistrar
- the registrar.public PojoCodec(List<KryoRegistrar> kryoRegistrars)
kryoRegistrars
- a list KryoRegistrars.public PojoCodec(KryoRegistrar kryoRegistrar, boolean useReferences)
kryoRegistrar
- the registrar.useReferences
- set to false if references are not required (if the object graph is known to be acyclical).
The default is 'true' which is less performant but more flexible.public PojoCodec(List<KryoRegistrar> kryoRegistrars, boolean useReferences)
kryoRegistrars
- a list KryoRegistrars.useReferences
- set to false if references are not required (if the object graph is known to be acyclical).
The default is 'true' which is less performant but more flexible.protected void doEncode(com.esotericsoftware.kryo.Kryo kryo, Object object, com.esotericsoftware.kryo.io.Output output)
AbstractKryoCodec
doEncode
in class AbstractKryoCodec
kryo
- the Kryo instanceobject
- the object to encodeoutput
- the Kryo Output instanceprotected <T> T doDecode(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<T> type)
AbstractKryoCodec
doDecode
in class AbstractKryoCodec
T
- the type for decoded objectkryo
- the Kryo instanceinput
- the Kryo Input instancetype
- the class of the decoded objectprotected void configureKryoInstance(com.esotericsoftware.kryo.Kryo kryo)
AbstractKryoCodec
configureKryoInstance
in class AbstractKryoCodec
kryo
- the Kryo instance