Class TaggedFieldSerializer<T>
java.lang.Object
com.esotericsoftware.kryo.Serializer<T>
com.esotericsoftware.kryo.serializers.FieldSerializer<T>
com.esotericsoftware.kryo.serializers.TaggedFieldSerializer<T>
- All Implemented Interfaces:
Comparator<FieldSerializer.CachedField>
Serializes objects using direct field assignment for fields that have been
tagged. Fields without the TaggedFieldSerializer.Tag
annotation are not serialized. New tagged fields can be added without invalidating previously serialized bytes. If any tagged
field is removed, previously serialized bytes are invalidated. Instead of removing fields, apply the Deprecated
annotation and they will not be serialized. If fields are public, bytecode generation will be used instead of reflection.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceIf true, this field will not be serialized.Nested classes/interfaces inherited from class com.esotericsoftware.kryo.serializers.FieldSerializer
FieldSerializer.CachedField<X>, FieldSerializer.Optional -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidReads bytes and returns a new object of the specified concrete type.voidremoveField(String fieldName) Removes a field so that it won't be serialized.voidWrites the bytes for the object to the output.Methods inherited from class com.esotericsoftware.kryo.serializers.FieldSerializer
compare, copy, create, createCopy, getField, getFields, getType, setFieldsAsAccessible, setFieldsCanBeNull, setFixedFieldTypes, setIgnoreSyntheticFieldsMethods inherited from class com.esotericsoftware.kryo.Serializer
getAcceptsNull, isImmutable, setAcceptsNull, setGenerics, setImmutableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
TaggedFieldSerializer
-
-
Method Details
-
initializeCachedFields
protected void initializeCachedFields()- Overrides:
initializeCachedFieldsin classFieldSerializer<T>
-
removeField
Description copied from class:FieldSerializerRemoves a field so that it won't be serialized.- Overrides:
removeFieldin classFieldSerializer<T>
-
write
Description copied from class:SerializerWrites the bytes for the object to the output.This method should not be called directly, instead this serializer can be passed to
Kryowrite methods that accept a serialier.- Overrides:
writein classFieldSerializer<T>object- May be null ifSerializer.getAcceptsNull()is true.
-
read
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 classFieldSerializer<T>- Returns:
- May be null if
Serializer.getAcceptsNull()is true.
-