Class ImmutableCollectionsSerializers.JdkImmutableMapSerializer
- java.lang.Object
-
- com.esotericsoftware.kryo.Serializer<T>
-
- com.esotericsoftware.kryo.serializers.MapSerializer<Map<Object,Object>>
-
- com.esotericsoftware.kryo.serializers.ImmutableCollectionsSerializers.JdkImmutableMapSerializer
-
- Enclosing class:
- ImmutableCollectionsSerializers
public static final class ImmutableCollectionsSerializers.JdkImmutableMapSerializer extends MapSerializer<Map<Object,Object>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esotericsoftware.kryo.serializers.MapSerializer
MapSerializer.BindMap
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Object,Object>
copy(Kryo kryo, Map<Object,Object> original)
Returns a copy of the specified object.protected Map<Object,Object>
create(Kryo kryo, Input input, Class<? extends Map<Object,Object>> type, int size)
Used byMapSerializer.read(Kryo, Input, Class)
to create the new object.protected Map<Object,Object>
createCopy(Kryo kryo, Map<Object,Object> original)
Map<Object,Object>
read(Kryo kryo, Input input, Class<? extends Map<Object,Object>> type)
Reads bytes and returns a new object of the specified concrete type.-
Methods inherited from class com.esotericsoftware.kryo.serializers.MapSerializer
getKeyClass, getKeySerializer, getValueClass, getValueSerializer, setKeyClass, setKeyClass, setKeysCanBeNull, setKeySerializer, setValueClass, setValueClass, setValuesCanBeNull, setValueSerializer, write, writeHeader
-
Methods inherited from class com.esotericsoftware.kryo.Serializer
getAcceptsNull, isImmutable, setAcceptsNull, setImmutable
-
-
-
-
Method Detail
-
create
protected Map<Object,Object> create(Kryo kryo, Input input, Class<? extends Map<Object,Object>> type, int size)
Description copied from class:MapSerializer
Used byMapSerializer.read(Kryo, Input, Class)
to create the new object. This can be overridden to customize object creation, eg to call a constructor with arguments. The default implementation usesKryo.newInstance(Class)
with a special case for HashMap.- Overrides:
create
in classMapSerializer<Map<Object,Object>>
-
createCopy
protected Map<Object,Object> createCopy(Kryo kryo, Map<Object,Object> original)
- Overrides:
createCopy
in classMapSerializer<Map<Object,Object>>
-
read
public Map<Object,Object> read(Kryo kryo, Input input, Class<? extends Map<Object,Object>> type)
Description copied from class:Serializer
Reads bytes and returns a new object of the specified concrete type.Before Kryo can be used to read child objects,
Kryo.reference(Object)
must be called with the parent object to ensure it can be referenced by the child objects. Any serializer that usesKryo
to read a child object may need to be reentrant.This method should not be called directly, instead this serializer can be passed to
Kryo
read methods that accept a serialier.- Overrides:
read
in classMapSerializer<Map<Object,Object>>
- Returns:
- May be null if
Serializer.getAcceptsNull()
is true.
-
copy
public Map<Object,Object> copy(Kryo kryo, Map<Object,Object> original)
Description copied from class:Serializer
Returns a copy of the specified object. The default implementation returns the original ifSerializer.isImmutable()
is true, else throwsKryoException
. Subclasses can optionall override this method to supportKryo.copy(Object)
.Before Kryo can be used to copy child objects,
Kryo.reference(Object)
must be called with the copy to ensure it can be referenced by the child objects. A serializer that usesKryo
to copy a child object may need to be reentrant.This method should not be called directly, instead this serializer can be passed to
Kryo
copy methods that accept a serialier.- Overrides:
copy
in classMapSerializer<Map<Object,Object>>
-
-