public class ReflectionSerializerFactory extends Object implements SerializerFactory
serializerClass
must either take an instance of Kryo
and an instance of Class
as its parameter, take
only a Kryo
or Class
as its only argument or take no arguments. If several of the described constructors are
found, the first found constructor is used, in the order as they were just described.Constructor and Description |
---|
ReflectionSerializerFactory(Class<? extends Serializer> serializerClass) |
Modifier and Type | Method and Description |
---|---|
Serializer |
makeSerializer(Kryo kryo,
Class<?> type)
Creates a new serializer
|
static Serializer |
makeSerializer(Kryo kryo,
Class<? extends Serializer> serializerClass,
Class<?> type)
Creates a new instance of the specified serializer for serializing the specified class.
|
public ReflectionSerializerFactory(Class<? extends Serializer> serializerClass)
public Serializer makeSerializer(Kryo kryo, Class<?> type)
SerializerFactory
makeSerializer
in interface SerializerFactory
kryo
- The serializer instance requesting the new serializer.type
- The type of the object that is to be serialized.type
.public static Serializer makeSerializer(Kryo kryo, Class<? extends Serializer> serializerClass, Class<?> type)
Copyright © 2018. All rights reserved.