Constructor and Description |
---|
KryoUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
applyRegistrations(com.esotericsoftware.kryo.Kryo kryo,
Collection<KryoRegistration> resolvedRegistrations)
Apply a list of
KryoRegistration to a Kryo instance. |
static <T> T |
copy(T from,
com.esotericsoftware.kryo.Kryo kryo,
TypeSerializer<T> serializer)
Tries to copy the given record from using the provided Kryo instance.
|
static <T> T |
copy(T from,
T reuse,
com.esotericsoftware.kryo.Kryo kryo,
TypeSerializer<T> serializer)
Tries to copy the given record from using the provided Kryo instance.
|
public static <T> T copy(T from, com.esotericsoftware.kryo.Kryo kryo, TypeSerializer<T> serializer)
T
- Type of the element to be copiedfrom
- Element to copykryo
- Kryo instance to useserializer
- TypeSerializer which is used in case of a Kryo failurepublic static <T> T copy(T from, T reuse, com.esotericsoftware.kryo.Kryo kryo, TypeSerializer<T> serializer)
T
- Type of the element to be copiedfrom
- Element to copyreuse
- Reuse element for the deserializationkryo
- Kryo instance to useserializer
- TypeSerializer which is used in case of a Kryo failurepublic static void applyRegistrations(com.esotericsoftware.kryo.Kryo kryo, Collection<KryoRegistration> resolvedRegistrations)
KryoRegistration
to a Kryo instance. The list of registrations is
assumed to already be a final resolution of all possible registration overwrites.
The registrations are applied in the given order and always specify the registration id as the next available id in the Kryo instance (providing the id just extra ensures nothing is overwritten, and isn't strictly required);
kryo
- the Kryo instance to apply the registrationsresolvedRegistrations
- the registrations, which should already be resolved of all
possible registration overwritesCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.