Class SerializerFactory.ReflectionSerializerFactory<T extends Serializer>

  • All Implemented Interfaces:
    SerializerFactory<T>
    Enclosing interface:
    SerializerFactory<T extends Serializer>

    public static class SerializerFactory.ReflectionSerializerFactory<T extends Serializer>
    extends SerializerFactory.BaseSerializerFactory<T>
    This factory instantiates new serializers of a given class via reflection. The constructors of the given serializer class 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 they were just described.
    Author:
    Rafael Winterhalter
    • Constructor Detail

      • ReflectionSerializerFactory

        public ReflectionSerializerFactory​(Class<T> serializerClass)
    • Method Detail

      • newSerializer

        public T newSerializer​(Kryo kryo,
                               Class type)
        Description copied from interface: SerializerFactory
        Creates and configures a new serializer.
        Parameters:
        kryo - The Kryo instance that will be used with the new serializer.
        type - The type of the object that the serializer will serialize.
      • newSerializer

        public static <T extends Serializer> T newSerializer​(Kryo kryo,
                                                             Class<T> serializerClass,
                                                             Class type)
        Creates a new instance of the specified serializer for serializing the specified class. Serializers must have a zero argument constructor or one that takes (Kryo), (Class), or (Kryo, Class).