public static interface Serializer.Options
builder()
to create new instances.
All options provided by the builder are safe to use with all serialization extensions. Serialization extensions
might provide more options, see option(String)
and the respective extension documentation.Modifier and Type | Interface and Description |
---|---|
static class |
Serializer.Options.Builder
Builder for
Serializer.Options . |
Modifier and Type | Field and Description |
---|---|
static Serializer.Options |
ALL_TYPE_INFO
State serializer options with both
rootTypeInfo() and nestedTypeInfo()
set to true. |
static Serializer.Options |
DEFAULT
Default state serializer options.
|
static Serializer.Options |
NO_TYPE_INFO
State serializer options with both
rootTypeInfo() and nestedTypeInfo()
set to false. |
Modifier and Type | Method and Description |
---|---|
static Serializer.Options.Builder |
builder()
Create a new builder of
Serializer.Options |
boolean |
nestedTypeInfo()
Include type information in the serialized form of nested values.
|
String |
option(String option)
Query for an option's value.
|
boolean |
rootTypeInfo() |
static final Serializer.Options DEFAULT
rootTypeInfo()
set to false.
nestedTypeInfo()
set to true.static final Serializer.Options NO_TYPE_INFO
rootTypeInfo()
and nestedTypeInfo()
set to false.static final Serializer.Options ALL_TYPE_INFO
rootTypeInfo()
and nestedTypeInfo()
set to true.boolean rootTypeInfo()
boolean nestedTypeInfo()
interface Parent { Property<String> something(); }
interface Child1 { Property<Long> number(); }
interface Child2 { Property<Duration> duration(); }
and want to serialize and deserialize a set of values like this one ;
interface MyValue { Property<Parent> polymorphicValue(); }
that is a view of a value composite that also has the following fragments ;
interface MyValueWithNumber { Property<Child1> polymorphicValue(); }
interface MyValueWithDuration { Property<Child2> polymorphicValue(); }
when deserializing, the Deserializer
needs a way to know which specialization
type to use to deserialize the value state, Child1 or Child2 in our example.
If the deserializer can't know it use the type information from the
ValueType
provided at deserialization time.
Disable it using Serializer.Options.Builder.withoutNestedTypeInfo()
if you are sure you don't need this.String option(String option)
option
- the optionstatic Serializer.Options.Builder builder()
Serializer.Options