Package io.avaje.jsonb
Interface Jsonb.Builder
- Enclosing interface:
- Jsonb
public static interface Jsonb.Builder
Build the Jsonb instance adding JsonAdapter, Factory or AdapterBuilder.
-
Method Summary
Modifier and TypeMethodDescriptionadd(JsonAdapter.Factory factory) Add a JsonAdapter.Factory which provides JsonAdapters to use.add(Jsonb.Component component) Add a Component which can provide multiple JsonAdapters and or configuration.<T> Jsonb.Builderadd(Type type, JsonAdapter<T> jsonAdapter) Add a JsonAdapter to use for the given type.add(Type type, Jsonb.AdapterBuilder builder) Add a AdapterBuilder which provides a JsonAdapter to use for the given type.build()Build and return the Jsonb instance with all the given adapters and factories registered.failOnUnknown(boolean failOnUnknown) Set failOnUnknown to true such that an exception is thrown when unknown properties are read in the json content.mathTypesAsString(boolean mathTypesAsString) Set to true for BigDecimal and BigInteger to serialise as String values rather than number values.
-
Method Details
-
failOnUnknown
Set failOnUnknown to true such that an exception is thrown when unknown properties are read in the json content. -
mathTypesAsString
Set to true for BigDecimal and BigInteger to serialise as String values rather than number values. -
add
Add a JsonAdapter to use for the given type. -
add
Add a AdapterBuilder which provides a JsonAdapter to use for the given type. -
add
Add a Component which can provide multiple JsonAdapters and or configuration. -
add
Add a JsonAdapter.Factory which provides JsonAdapters to use. -
build
Build and return the Jsonb instance with all the given adapters and factories registered.
-