Class FieldSerializer.FieldSerializerConfig
- java.lang.Object
-
- com.esotericsoftware.kryo.serializers.FieldSerializer.FieldSerializerConfig
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
CompatibleFieldSerializer.CompatibleFieldSerializerConfig,TaggedFieldSerializer.TaggedFieldSerializerConfig,VersionFieldSerializer.VersionFieldSerializerConfig
- Enclosing class:
- FieldSerializer<T>
public static class FieldSerializer.FieldSerializerConfig extends java.lang.Object implements java.lang.CloneableConfiguration for FieldSerializer instances.
-
-
Constructor Summary
Constructors Constructor Description FieldSerializerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldSerializer.FieldSerializerConfigclone()booleangetCopyTransient()booleangetExtendedFieldNames()booleangetFieldsCanBeNull()booleangetFixedFieldTypes()booleangetIgnoreSyntheticFields()booleangetSerializeTransient()booleangetSetFieldsAsAccessible()booleangetVariableLengthEncoding()voidsetCopyTransient(boolean copyTransient)If false, whenKryo.copy(Object)is called all transient fields that are accessible will be ignored from being copied.voidsetExtendedFieldNames(boolean extendedFieldNames)When true, field names are prefixed by their declaring class.voidsetFieldsAsAccessible(boolean setFieldsAsAccessible)Controls which fields are serialized.voidsetFieldsCanBeNull(boolean fieldsCanBeNull)Sets the default value forFieldSerializer.CachedField.setCanBeNull(boolean).voidsetFixedFieldTypes(boolean fixedFieldTypes)Sets the default value forFieldSerializer.CachedField.setValueClass(Class)to the field's declared type.voidsetIgnoreSyntheticFields(boolean ignoreSyntheticFields)Controls if synthetic fields are serialized.voidsetSerializeTransient(boolean serializeTransient)If set, transient fields will be serialized.voidsetVariableLengthEncoding(boolean varEncoding)When true, variable length values are used for int and long fields.
-
-
-
Method Detail
-
clone
public FieldSerializer.FieldSerializerConfig clone()
- Overrides:
clonein classjava.lang.Object
-
setFieldsCanBeNull
public void setFieldsCanBeNull(boolean fieldsCanBeNull)
Sets the default value forFieldSerializer.CachedField.setCanBeNull(boolean).- Parameters:
fieldsCanBeNull- False if none of the fields are null. Saves 0-1 byte per field. True if it is not known (default).
-
getFieldsCanBeNull
public boolean getFieldsCanBeNull()
-
setFieldsAsAccessible
public void setFieldsAsAccessible(boolean setFieldsAsAccessible)
Controls which fields are serialized.- Parameters:
setFieldsAsAccessible- If true, all non-transient fields (inlcuding private fields) will be serialized andset as accessibleif necessary (default). If false, only fields in the public API will be serialized.
-
getSetFieldsAsAccessible
public boolean getSetFieldsAsAccessible()
-
setIgnoreSyntheticFields
public void setIgnoreSyntheticFields(boolean ignoreSyntheticFields)
Controls if synthetic fields are serialized. Default is true.- Parameters:
ignoreSyntheticFields- If true, only non-synthetic fields will be serialized.
-
getIgnoreSyntheticFields
public boolean getIgnoreSyntheticFields()
-
setFixedFieldTypes
public void setFixedFieldTypes(boolean fixedFieldTypes)
Sets the default value forFieldSerializer.CachedField.setValueClass(Class)to the field's declared type. This allows FieldSerializer to be more efficient, since it knows field values will not be a subclass of their declared type. Default is false.
-
getFixedFieldTypes
public boolean getFixedFieldTypes()
-
setCopyTransient
public void setCopyTransient(boolean copyTransient)
If false, whenKryo.copy(Object)is called all transient fields that are accessible will be ignored from being copied. Default is true.
-
getCopyTransient
public boolean getCopyTransient()
-
setSerializeTransient
public void setSerializeTransient(boolean serializeTransient)
If set, transient fields will be serialized. Default is false.
-
getSerializeTransient
public boolean getSerializeTransient()
-
setVariableLengthEncoding
public void setVariableLengthEncoding(boolean varEncoding)
When true, variable length values are used for int and long fields. Default is true.
-
getVariableLengthEncoding
public boolean getVariableLengthEncoding()
-
setExtendedFieldNames
public void setExtendedFieldNames(boolean extendedFieldNames)
When true, field names are prefixed by their declaring class. This can avoid conflicts when a subclass has a field with the same name as a super class. Default is false.
-
getExtendedFieldNames
public boolean getExtendedFieldNames()
-
-