Class FieldSerializer.FieldSerializerConfig
- java.lang.Object
-
- com.esotericsoftware.kryo.serializers.FieldSerializer.FieldSerializerConfig
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
CompatibleFieldSerializer.CompatibleFieldSerializerConfig
,TaggedFieldSerializer.TaggedFieldSerializerConfig
,VersionFieldSerializer.VersionFieldSerializerConfig
- Enclosing class:
- FieldSerializer<T>
public static class FieldSerializer.FieldSerializerConfig extends Object implements Cloneable
Configuration for FieldSerializer instances.
-
-
Constructor Summary
Constructors Constructor Description FieldSerializerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldSerializer.FieldSerializerConfig
clone()
boolean
getCopyTransient()
boolean
getExtendedFieldNames()
boolean
getFieldsCanBeNull()
boolean
getFixedFieldTypes()
boolean
getIgnoreSyntheticFields()
boolean
getSerializeTransient()
boolean
getSetFieldsAsAccessible()
boolean
getVariableLengthEncoding()
void
setCopyTransient(boolean copyTransient)
If false, whenKryo.copy(Object)
is called all transient fields that are accessible will be ignored from being copied.void
setExtendedFieldNames(boolean extendedFieldNames)
When true, field names are prefixed by their declaring class.void
setFieldsAsAccessible(boolean setFieldsAsAccessible)
Controls which fields are serialized.void
setFieldsCanBeNull(boolean fieldsCanBeNull)
Sets the default value forFieldSerializer.CachedField.setCanBeNull(boolean)
.void
setFixedFieldTypes(boolean fixedFieldTypes)
Sets the default value forFieldSerializer.CachedField.setValueClass(Class)
to the field's declared type.void
setIgnoreSyntheticFields(boolean ignoreSyntheticFields)
Controls if synthetic fields are serialized.void
setSerializeTransient(boolean serializeTransient)
If set, transient fields will be serialized.void
setVariableLengthEncoding(boolean varEncoding)
When true, variable length values are used for int and long fields.
-
-
-
Method Detail
-
clone
public FieldSerializer.FieldSerializerConfig clone()
-
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 accessible
if 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()
-
-