Interface SerializationConfiguration
@NullMarked
public interface SerializationConfiguration
Configuration for serialization.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumSerialization format features. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<SerializationConfiguration.Feature> static final String -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDetermines whether generated serializers should fall back to the runtime serializer.default Set<SerializationConfiguration.Feature> features()Returns the active format features for serialization.features(@Nullable SerializationConfiguration configuration) Resolve the active serialization format features for the given configuration.booleandefault booleanDetermines whether properties should be serialized in alphabetical order.default booleanDetermines whether zone ids are included when serializing zoned date/time values.default booleanDetermines whether timestamps are written with nanosecond precision.default booleanDetermines whether single-element arrays should be written as unwrapped scalar values.default booleanDetermines whether map entries should be written sorted by key.
-
Field Details
-
PREFIX
- See Also:
-
DEFAULT_FEATURES
-
-
Method Details
-
getInclusion
- Returns:
- The default inclusion to use. Defaults to
SerdeConfig.SerInclude.NON_EMPTY.
-
isAlwaysSerializeErrorsAsList
@Bindable(defaultValue="true") boolean isAlwaysSerializeErrorsAsList()- Returns:
- Whether to serialize errors as a list.
- See Also:
-
sortPropertiesAlphabetically
@Bindable(defaultValue="false") default boolean sortPropertiesAlphabetically()Determines whether properties should be serialized in alphabetical order.- Returns:
- true if properties should be sorted alphabetically, false otherwise
- Since:
- 2.14
-
writeDateTimestampsAsNanoseconds
@Bindable(defaultValue="true") default boolean writeDateTimestampsAsNanoseconds()Determines whether timestamps are written with nanosecond precision.- Returns:
- true if timestamp values should preserve nanoseconds
- Since:
- 3.0
-
writeDatesWithZoneId
@Bindable(defaultValue="true") default boolean writeDatesWithZoneId()Determines whether zone ids are included when serializing zoned date/time values.- Returns:
- true if zone ids should be written
- Since:
- 3.0
-
writeSingleElemArraysUnwrapped
@Bindable(defaultValue="false") default boolean writeSingleElemArraysUnwrapped()Determines whether single-element arrays should be written as unwrapped scalar values.- Returns:
- true if single-element arrays should be unwrapped
- Since:
- 3.0
-
writeSortedMapEntries
@Bindable(defaultValue="false") default boolean writeSortedMapEntries()Determines whether map entries should be written sorted by key.- Returns:
- true if map entries should be sorted
- Since:
- 3.0
-
disableGeneratedSerializer
@Bindable(defaultValue="false") default boolean disableGeneratedSerializer()Determines whether generated serializers should fall back to the runtime serializer.- Returns:
- true if generated serializers should be disabled
- Since:
- 3.0
-
features
Returns the active format features for serialization.- Returns:
- The active format features for serialization.
- Since:
- 3.0
-
features
static Set<SerializationConfiguration.Feature> features(@Nullable SerializationConfiguration configuration) Resolve the active serialization format features for the given configuration.- Parameters:
configuration- The serialization configuration- Returns:
- The active serialization format features
- Since:
- 3.0
-