Constructor and Description |
---|
KryoUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
applyRegistrations(com.esotericsoftware.kryo.Kryo kryo,
Collection<KryoRegistration> resolvedRegistrations,
int firstRegistrationId)
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, int firstRegistrationId)
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,
using the given firstRegistrationId
and incrementing it for each registration.
kryo
- the Kryo instance to apply the registrationsresolvedRegistrations
- the registrations, which should already be resolved of all
possible registration overwritesfirstRegistrationId
- the first registration id to useCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.