public static class FieldSerializer.FieldSerializerConfig
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
FieldSerializerConfig() |
Modifier and Type | Method and 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, when
Kryo.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 for
FieldSerializer.CachedField.setCanBeNull(boolean) . |
void |
setFixedFieldTypes(boolean fixedFieldTypes)
Sets the default value for
FieldSerializer.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.
|
public FieldSerializer.FieldSerializerConfig clone()
clone
in class java.lang.Object
public void setFieldsCanBeNull(boolean fieldsCanBeNull)
FieldSerializer.CachedField.setCanBeNull(boolean)
.fieldsCanBeNull
- False if none of the fields are null. Saves 0-1 byte per field. True if it is not known
(default).public boolean getFieldsCanBeNull()
public void setFieldsAsAccessible(boolean setFieldsAsAccessible)
setFieldsAsAccessible
- If true, all non-transient fields (inlcuding private fields) will be serialized and
set as accessible
if necessary (default). If false, only
fields in the public API will be serialized.public boolean getSetFieldsAsAccessible()
public void setIgnoreSyntheticFields(boolean ignoreSyntheticFields)
ignoreSyntheticFields
- If true, only non-synthetic fields will be serialized.public boolean getIgnoreSyntheticFields()
public void setFixedFieldTypes(boolean fixedFieldTypes)
FieldSerializer.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.public boolean getFixedFieldTypes()
public void setCopyTransient(boolean copyTransient)
Kryo.copy(Object)
is called all transient fields that are accessible will be ignored from being
copied. Default is true.public boolean getCopyTransient()
public void setSerializeTransient(boolean serializeTransient)
public boolean getSerializeTransient()
public void setVariableLengthEncoding(boolean varEncoding)
public boolean getVariableLengthEncoding()
public void setExtendedFieldNames(boolean extendedFieldNames)
public boolean getExtendedFieldNames()
Copyright © 2019. All Rights Reserved.