Package com.esotericsoftware.kryo
Class SerializerFactory.SingletonSerializerFactory<T extends Serializer>
- java.lang.Object
-
- com.esotericsoftware.kryo.SerializerFactory.BaseSerializerFactory<T>
-
- com.esotericsoftware.kryo.SerializerFactory.SingletonSerializerFactory<T>
-
- 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.esotericsoftware.kryo.SerializerFactory
SerializerFactory.BaseSerializerFactory<T extends Serializer>, SerializerFactory.CompatibleFieldSerializerFactory, SerializerFactory.FieldSerializerFactory, SerializerFactory.ReflectionSerializerFactory<T extends Serializer>, SerializerFactory.SingletonSerializerFactory<T extends Serializer>, SerializerFactory.TaggedFieldSerializerFactory, SerializerFactory.VersionFieldSerializerFactory
-
-
Constructor Summary
Constructors Constructor Description SingletonSerializerFactory(T serializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
newSerializer(Kryo kryo, Class type)
Creates and configures a new serializer.-
Methods inherited from class com.esotericsoftware.kryo.SerializerFactory.BaseSerializerFactory
isSupported
-
-
-
-
Constructor Detail
-
SingletonSerializerFactory
public SingletonSerializerFactory(T serializer)
-
-
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.
-
-