Package io.micronaut.json
Class JsonStreamConfig
- java.lang.Object
-
- io.micronaut.json.JsonStreamConfig
-
public final class JsonStreamConfig extends java.lang.ObjectConfiguration for json stream parsing and generation. Immutable.- Since:
- 3.1
-
-
Field Summary
Fields Modifier and Type Field Description static JsonStreamConfigDEFAULTThe default stream configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanuseBigDecimalForFloats()booleanuseBigIntegerForInts()JsonStreamConfigwithUseBigDecimalForFloats(boolean useBigDecimalForFloats)Whether all normal floating point literals should be represented asBigDecimal.JsonStreamConfigwithUseBigIntegerForInts(boolean useBigIntegerForInts)
-
-
-
Field Detail
-
DEFAULT
public static final JsonStreamConfig DEFAULT
The default stream configuration.
-
-
Method Detail
-
useBigDecimalForFloats
public boolean useBigDecimalForFloats()
- Returns:
- Whether
BigDecimals should be used for parsing floating-point json numbers.
-
withUseBigDecimalForFloats
public JsonStreamConfig withUseBigDecimalForFloats(boolean useBigDecimalForFloats)
Whether all normal floating point literals should be represented asBigDecimal. Note thatFloat.NaN,Float.POSITIVE_INFINITYandFloat.NEGATIVE_INFINITYmay still be represented as float, if the input supports those literals.- Parameters:
useBigDecimalForFloats- The new value foruseBigDecimalForFloats- Returns:
- A copy of this config instance, with
useBigDecimalForFloatsset to the new value.
-
useBigIntegerForInts
public boolean useBigIntegerForInts()
- Returns:
- Whether
BigIntegers should be used for parsing integer json numbers.
-
withUseBigIntegerForInts
public JsonStreamConfig withUseBigIntegerForInts(boolean useBigIntegerForInts)
- Parameters:
useBigIntegerForInts- The new value foruseBigIntegerForInts- Returns:
- A copy of this config instance, with
useBigIntegerForIntsset to the new value.
-
-