Class SerializerFactory.SingletonSerializerFactory<T extends Serializer>

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

    public static class SerializerFactory.SingletonSerializerFactory<T extends Serializer>
    extends SerializerFactory.BaseSerializerFactory<T>
    A serializer factory that always returns a given serializer instance rather than creating new serializer instances. It can be used when multiple types should be serialized by the same serializer.
    Author:
    Rafael Winterhalter
    • Constructor Detail

      • SingletonSerializerFactory

        public SingletonSerializerFactory​(T serializer)
    • Method Detail

      • newSerializer

        public T newSerializer​(Kryo kryo,
                               java.lang.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.