Class ImmutableCollectionsSerializers.JdkImmutableSetSerializer
- java.lang.Object
-
- com.esotericsoftware.kryo.Serializer<T>
-
- com.esotericsoftware.kryo.serializers.CollectionSerializer<Set<Object>>
-
- com.esotericsoftware.kryo.serializers.ImmutableCollectionsSerializers.JdkImmutableSetSerializer
-
- Enclosing class:
- ImmutableCollectionsSerializers
public static final class ImmutableCollectionsSerializers.JdkImmutableSetSerializer extends CollectionSerializer<Set<Object>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esotericsoftware.kryo.serializers.CollectionSerializer
CollectionSerializer.BindCollection
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Object>copy(Kryo kryo, Set<Object> original)Returns a copy of the specified object.protected Set<Object>create(Kryo kryo, Input input, Class<? extends Set<Object>> type, int size)Used byCollectionSerializer.read(Kryo, Input, Class)to create the new object.protected Set<Object>createCopy(Kryo kryo, Set<Object> original)Used byCollectionSerializer.copy(Kryo, Collection)to create the new object.Set<Object>read(Kryo kryo, Input input, Class<? extends Set<Object>> type)Reads bytes and returns a new object of the specified concrete type.-
Methods inherited from class com.esotericsoftware.kryo.serializers.CollectionSerializer
getElementClass, getElementSerializer, setElementClass, setElementClass, setElementsCanBeNull, setElementSerializer, write, writeHeader
-
Methods inherited from class com.esotericsoftware.kryo.Serializer
getAcceptsNull, isImmutable, setAcceptsNull, setImmutable
-
-
-
-
Method Detail
-
create
protected Set<Object> create(Kryo kryo, Input input, Class<? extends Set<Object>> type, int size)
Description copied from class:CollectionSerializerUsed byCollectionSerializer.read(Kryo, Input, Class)to create the new object. This can be overridden to customize object creation (eg to call a constructor with arguments), optionally reading bytes written inCollectionSerializer.writeHeader(Kryo, Output, Collection). The default implementation usesKryo.newInstance(Class)with special cases for ArrayList and HashSet.- Overrides:
createin classCollectionSerializer<Set<Object>>
-
createCopy
protected Set<Object> createCopy(Kryo kryo, Set<Object> original)
Description copied from class:CollectionSerializerUsed byCollectionSerializer.copy(Kryo, Collection)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).- Overrides:
createCopyin classCollectionSerializer<Set<Object>>
-
read
public Set<Object> read(Kryo kryo, Input input, Class<? extends Set<Object>> type)
Description copied from class:SerializerReads 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 usesKryoto read a child object may need to be reentrant.This method should not be called directly, instead this serializer can be passed to
Kryoread methods that accept a serialier.- Overrides:
readin classCollectionSerializer<Set<Object>>- Returns:
- May be null if
Serializer.getAcceptsNull()is true.
-
copy
public Set<Object> copy(Kryo kryo, Set<Object> original)
Description copied from class:SerializerReturns 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 usesKryoto copy a child object may need to be reentrant.This method should not be called directly, instead this serializer can be passed to
Kryocopy methods that accept a serialier.- Overrides:
copyin classCollectionSerializer<Set<Object>>
-
-