public enum ToNumberPolicy extends java.lang.Enum<ToNumberPolicy> implements ToNumberStrategy
Object and Number.ToNumberStrategy| Enum Constant and Description |
|---|
BIG_DECIMAL
Using this policy will ensure that numbers will be read as numbers of arbitrary length
using
BigDecimal. |
DOUBLE
Using this policy will ensure that numbers will be read as
Double values. |
LAZILY_PARSED_NUMBER
Using this policy will ensure that numbers will be read as a lazily parsed number backed
by a string.
|
LONG_OR_DOUBLE
Using this policy will ensure that numbers will be read as
Long or Double
values depending on how JSON numbers are represented: Long if the JSON number can
be parsed as a Long value, or otherwise Double if it can be parsed as a
Double value. |
| Modifier and Type | Method and Description |
|---|---|
static ToNumberPolicy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ToNumberPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfreadNumberpublic static final ToNumberPolicy DOUBLE
Double values.
This is the default strategy used during deserialization of numbers as Object.public static final ToNumberPolicy LAZILY_PARSED_NUMBER
Number.public static final ToNumberPolicy LONG_OR_DOUBLE
Long or Double
values depending on how JSON numbers are represented: Long if the JSON number can
be parsed as a Long value, or otherwise Double if it can be parsed as a
Double value. If the parsed double-precision number results in a positive or negative
infinity (Double.isInfinite()) or a NaN (Double.isNaN()) value and the
JsonReader is not lenient, a MalformedJsonException
is thrown.public static final ToNumberPolicy BIG_DECIMAL
BigDecimal.public static ToNumberPolicy[] values()
for (ToNumberPolicy c : ToNumberPolicy.values()) System.out.println(c);
public static ToNumberPolicy valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullCopyright © 2010 - 2023 Adobe. All Rights Reserved