Class FieldSerializer.FieldSerializerConfig

    • Constructor Detail

      • FieldSerializerConfig

        public FieldSerializerConfig()
    • Method Detail

      • setFieldsCanBeNull

        public void setFieldsCanBeNull​(boolean fieldsCanBeNull)
        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 and set 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 for 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.
      • getFixedFieldTypes

        public boolean getFixedFieldTypes()
      • setCopyTransient

        public void setCopyTransient​(boolean copyTransient)
        If false, when Kryo.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()
      • 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()