- All Implemented Interfaces:
Serializable
,Iterable<JsonNode>
,TreeNode
,JacksonSerializable
- Direct Known Subclasses:
DecimalNode
,DoubleNode
,FloatNode
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.JsonNode
JsonNode.OverwriteMode
Nested classes/interfaces inherited from interface tools.jackson.databind.JacksonSerializable
JacksonSerializable.Base
-
Field Summary
Fields inherited from class tools.jackson.databind.node.ValueNode
BD_MAX_INTEGER, BD_MAX_LONG, BD_MAX_SHORT, BD_MIN_INTEGER, BD_MIN_LONG, BD_MIN_SHORT, BI_MAX_INTEGER, BI_MAX_LONG, BI_MAX_SHORT, BI_MIN_INTEGER, BI_MIN_LONG, BI_MIN_SHORT, MISSING
Fields inherited from class tools.jackson.databind.node.BaseJsonNode
OPT_FALSE, OPT_TRUE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BigInteger
Method for sub-classes to implement; returns the underlying value as aBigInteger
without any checks (wrt NaN), so caller must ensure validity prior to callingprotected abstract BigDecimal
Method for sub-classes to implement; returns the underlying value as aBigDecimal
without any checks (wrt NaN), so caller must ensure validity prior to callingprotected abstract int
Method for sub-classes to implement; returns the underlying value as aint
without any checks (wrt NaN or value range), so caller must ensure validity prior to callingprotected abstract long
Method for sub-classes to implement; returns the underlying value as along
without any checks (wrt NaN or value range), so caller must ensure validity prior to callingprotected abstract short
Method for sub-classes to implement; returns the underlying value as ashort
without any checks (wrt NaN or value range), so caller must ensure validity prior to callingprotected abstract boolean
protected abstract boolean
protected abstract boolean
protected abstract boolean
final BigInteger
Method similar toJsonNode.bigIntegerValue()
but in addition to coercing Number values (same asJsonNode.bigIntegerValue()
), will also try to coerce a couple of additional types (or cases): JSON Floating-point numbers with fractions (ones without fractions are ok forJsonNode.bigIntegerValue()
) will be truncated to integer value (like withBigDecimal.toBigInteger()
)) JSON Strings that represent JSON Numbers ("stringified" numbers) JSON Null (converted to0
)) POJO nodes that contain Number valuesfinal BigInteger
asBigInteger
(BigInteger defaultValue) Method similar toJsonNode.asBigInteger()
, but that will return specifieddefaultValue
if this node cannot be converted toBigInteger
.final Optional<BigInteger>
Method similar toJsonNode.bigIntegerValue()
, but that will return empty (Optional.empty()
) if this node cannot be converted to JavaBigInteger
.Method that will try to access value of this node as aBigDecimal
: but if node value cannot be expressed exactly as aBigDecimal
, aJsonNodeException
will be thrown.asDecimal
(BigDecimal defaultValue) Method similar toJsonNode.asDecimal()
, but that will returndefaultValue
if this node cannot be coerced to JavaBigDecimal
.Method similar toJsonNode.asDecimal()
, but that will return emptyOptional
(Optional.empty()
) if this node cannot be coerced toBigDecimal
.int
asInt()
Method similar toJsonNode.intValue()
but in addition to coercing Number values (same asJsonNode.intValue()
), will also try to coerce a couple of additional types (or cases): JSON Floating-point numbers with fractions (ones without fractions are ok forJsonNode.intValue()
) will be truncated toint
(if (and only if) they fit inint
range).int
asInt
(int defaultValue) Method similar toJsonNode.intValue()
, but that will return specifieddefaultValue
if this node cannot be converted toint
.asIntOpt()
Method similar toJsonNode.asInt()
, but that will return (OptionalInt.empty()
) if this node cannot be coerced toint
.final long
asLong()
Method similar toJsonNode.longValue()
but in addition to coercing Number values (same asJsonNode.longValue()
), will also try to coerce a couple of additional types (or cases): JSON Floating-point numbers with fractions (ones without fractions are ok forJsonNode.longValue()
) will be truncated tolong
(if (and only if) they fit inlong
range).final long
asLong
(long defaultValue) Method similar toJsonNode.asLong()
, but that will return specifieddefaultValue
if this node cannot be coerced tolong
(instead of throwing an exception).final OptionalLong
Method similar toJsonNode.asLong()
, but that will return (OptionalLong.empty()
) if this node cannot be coerced tolong
.short
asShort()
Method similar toJsonNode.shortValue()
but in addition to coercing Number values (same asJsonNode.shortValue()
), will also try to coerce a couple of additional types (or cases): JSON Floating-point numbers with fractions (ones without fractions are ok forJsonNode.shortValue()
) will be truncated toshort
(if (and only if) they fit inshort
range).short
asShort
(short defaultValue) Method similar toJsonNode.shortValue()
, but that will return specifieddefaultValue
if this node cannot be converted toshort
.Method similar toJsonNode.asShort()
, but that will return (Optional.empty()
) if this node cannot be coerced toshort
.final JsonToken
asToken()
Method that can be used for efficient type detection when using stream abstraction for traversing nodes.final BigInteger
Method that will try to access value of this node as aBigInteger
, but if node value cannot be expressed exactly as aBigInteger
, aJsonNodeException
will be thrown.final BigInteger
bigIntegerValue
(BigInteger defaultValue) Method similar toJsonNode.bigIntegerValue()
, but that will return specifieddefaultValue
if this node cannot be converted to JavaBigInteger
.final Optional<BigInteger>
Method similar toJsonNode.bigIntegerValue()
, but that will return empty (Optional.empty()
) if this node cannot be converted to JavaBigInteger
.final boolean
Method that can be used to check whether contained value is numeric (returns true forJsonNode.isNumber()
) and can be converted without loss to integral number (specifically,BigInteger
but potentially others, seeJsonNode.canConvertToInt()
andJsonNode.canConvertToInt()
).final boolean
Method that can be used to check whether this node is a numeric node (JsonNode.isNumber()
would return true) AND can be converted without loss toint
(that is, its value fits in Java's 32-bit signed integer type,int
and if it is a floating-point number, it does not have fractional part).final boolean
Method that can be used to check whether this node is a numeric node (JsonNode.isNumber()
would return true) AND can be converted without loss tolong
(that is, its value fits in Java's 64-bit signed integer type,long
and if it is a floating-point number, it does not have fractional part).final boolean
Method that can be used to check whether this node is a numeric node (JsonNode.isNumber()
would return true) AND can be converted without loss toshort
(that is, its value fits in Java's 16-bit signed integer type,short
and if it is a floating-point number, it does not have fractional part).Method that will try to access value of this node as a JavaBigDecimal
: but if node value cannot be expressed exactly as aBigDecimal
, aJsonNodeException
will be thrown.decimalValue
(BigDecimal defaultValue) Method similar toJsonNode.decimalValue()
, but that will returndefaultValue
if this node cannot be coerced to JavaBigDecimal
.Method similar toJsonNode.decimalValue()
, but that will return emptyOptional
(Optional.empty()
) if this node cannot be coerced toBigDecimal
.final int
intValue()
Method that will try to access value of this node as a Javaint
: but if node value cannot be expressed exactly as anint
, aJsonNodeException
will be thrown.final int
intValue
(int defaultValue) Method similar toJsonNode.intValue()
, but that will return specifieddefaultValue
if this node cannot be converted to Javaint
.final OptionalInt
Method similar toJsonNode.intValue()
, but that will return emptyOptionalInt
(OptionalInt.empty()
) if this node cannot be converted to Javaint
.final boolean
final long
Method that will try to access value of this node as a Javalong
: but if node value cannot be expressed exactly as along
, aJsonNodeException
will be thrown.final long
longValue
(long defaultValue) Method similar toJsonNode.longValue()
, but that will return specifieddefaultValue
if this node cannot be converted tolong
.final OptionalLong
Method similar toJsonNode.longValue()
, but that will return emptyOptionalLong
(OptionalLong.empty()
) if this node cannot be converted to Javalong
.final short
Method that will try to access value of this node as 16-bit signed integer value (Javashort
): but if node value cannot be expressed exactly as ashort
, aJsonNodeException
will be thrown.final short
shortValue
(short defaultValue) Method similar toJsonNode.shortValue()
, but that will return specifieddefaultValue
if this node cannot be converted to Javashort
.Method similar toJsonNode.shortValue()
, but that will return emptyOptional<Short>
(Optional.empty()
) if this node cannot be converted to Javashort
.Methods inherited from class tools.jackson.databind.node.NumericNode
_asString, _valueDesc, asDouble, asDouble, asDoubleOpt, asFloat, asFloat, asFloatOpt, deepCopy, doubleValue, doubleValue, doubleValueOpt, floatValue, floatValue, floatValueOpt, getNodeType, isNaN, numberType, numberValue
Methods inherited from class tools.jackson.databind.node.ValueNode
_at, findParent, findParents, findValue, findValues, findValuesAsString, get, get, has, has, hasNonNull, hasNonNull, isEmpty, path, path, serializeWithType
Methods inherited from class tools.jackson.databind.node.BaseJsonNode
_asBoolean, _jsonPointerIfValid, _reportBigDecimalCoercionNaNFail, _reportBigIntegerCoercionFractionFail, _reportBigIntegerCoercionNaNFail, _reportCoercionFail, _reportDoubleCoercionRangeFail, _reportFloatCoercionRangeFail, _reportIntCoercionFractionFail, _reportIntCoercionNaNFail, _reportIntCoercionRangeFail, _reportLongCoercionFractionFail, _reportLongCoercionNaNFail, _reportLongCoercionRangeFail, _reportShortCoercionFractionFail, _reportShortCoercionRangeFail, _reportWrongNodeType, _withArray, _withObject, _withXxxMayReplace, _withXxxVerifyReplace, asBoolean, asBoolean, asBooleanOpt, asString, asString, asStringOpt, binaryValue, booleanValue, booleanValue, booleanValueOpt, findPath, hashCode, isEmbeddedValue, isMissingNode, required, required, serialize, stringValue, stringValue, stringValueOpt, toPrettyString, toString, traverse, withArray, withObject
Methods inherited from class tools.jackson.databind.JsonNode
_reportRequiredViolation, _reportUnsupportedOperation, _this, asOptional, asText, asText, at, at, equals, equals, findParents, findValues, findValuesAsString, forEachEntry, isArray, isBigDecimal, isBigInteger, isBinary, isBoolean, isContainer, isDouble, isFloat, isInt, isIntegralNumber, isLong, isNull, isNumber, isObject, isPojo, isShort, isString, isTextual, isValueNode, iterator, optional, optional, properties, propertyNames, propertyStream, require, requiredAt, requiredAt, requireNonNull, size, spliterator, textValue, values, valueStream, withArray, withArray, withArray, withArrayProperty, withObject, withObject, withObject, withObjectProperty
Methods inherited from class tools.jackson.databind.JacksonSerializable.Base
isEmpty
-
Constructor Details
-
NumericFPNode
public NumericFPNode()
-
-
Method Details
-
asToken
Description copied from class:BaseJsonNode
Method that can be used for efficient type detection when using stream abstraction for traversing nodes. Will return the firstJsonToken
that equivalent stream event would produce (for most nodes there is just one token but for structured/container types multiple) -
isFloatingPointNumber
public final boolean isFloatingPointNumber()- Overrides:
isFloatingPointNumber
in classJsonNode
- Returns:
- True if this node represents a non-integral numeric JSON value
-
canConvertToShort
public final boolean canConvertToShort()Description copied from class:JsonNode
Method that can be used to check whether this node is a numeric node (JsonNode.isNumber()
would return true) AND can be converted without loss toshort
(that is, its value fits in Java's 16-bit signed integer type,short
and if it is a floating-point number, it does not have fractional part).NOTE: this method does not consider possible value type conversion from non-number types like JSON String into Number; so even if this method returns false, it is possible that
JsonNode.asShort()
could still succeed.- Specified by:
canConvertToShort
in classNumericNode
-
canConvertToInt
public final boolean canConvertToInt()Description copied from class:JsonNode
Method that can be used to check whether this node is a numeric node (JsonNode.isNumber()
would return true) AND can be converted without loss toint
(that is, its value fits in Java's 32-bit signed integer type,int
and if it is a floating-point number, it does not have fractional part).NOTE: this method does not consider possible value type conversion from non-number types like JSON String into Number; so even if this method returns false, it is possible that
JsonNode.asInt()
could still succeed.- Specified by:
canConvertToInt
in classNumericNode
-
canConvertToLong
public final boolean canConvertToLong()Description copied from class:JsonNode
Method that can be used to check whether this node is a numeric node (JsonNode.isNumber()
would return true) AND can be converted without loss tolong
(that is, its value fits in Java's 64-bit signed integer type,long
and if it is a floating-point number, it does not have fractional part).NOTE: this method does not consider possible value type conversion from non-number types like JSON String into Number; so even if this method returns false, it is possible that
JsonNode.asLong()
could still succeed.- Specified by:
canConvertToLong
in classNumericNode
-
canConvertToExactIntegral
public final boolean canConvertToExactIntegral()Description copied from class:JsonNode
Method that can be used to check whether contained value is numeric (returns true forJsonNode.isNumber()
) and can be converted without loss to integral number (specifically,BigInteger
but potentially others, seeJsonNode.canConvertToInt()
andJsonNode.canConvertToInt()
). Latter part allows floating-point numbers (for whichJsonNode.isFloatingPointNumber()
returnstrue
) that do not have fractional part. Note that "not-a-number" values ofdouble
andfloat
will returnfalse
as they can not be converted to matching integral representations.- Overrides:
canConvertToExactIntegral
in classJsonNode
- Returns:
- True if the value is an actual number with no fractional part; false for non-numeric types, NaN representations of floating-point numbers, and floating-point numbers with fractional part.
-
shortValue
public final short shortValue()Description copied from class:JsonNode
Method that will try to access value of this node as 16-bit signed integer value (Javashort
): but if node value cannot be expressed exactly as ashort
, aJsonNodeException
will be thrown. Access works for following cases:- JSON Integer values that fit in Java 16-bit signed
short
range - JSON Floating-point values that fit in Java 16-bit signed
short
range AND do not have fractional part.
- Specified by:
shortValue
in classNumericNode
- Returns:
Short
value this node represents, if possible to accurately represent
- JSON Integer values that fit in Java 16-bit signed
-
shortValue
public final short shortValue(short defaultValue) Description copied from class:JsonNode
Method similar toJsonNode.shortValue()
, but that will return specifieddefaultValue
if this node cannot be converted to Javashort
.- Specified by:
shortValue
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted to Javashort
- Returns:
- Java
short
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
shortValueOpt
Description copied from class:JsonNode
Method similar toJsonNode.shortValue()
, but that will return emptyOptional<Short>
(Optional.empty()
) if this node cannot be converted to Javashort
.- Specified by:
shortValueOpt
in classNumericNode
- Returns:
- Java
short
value this node represents, asOptional<Short>
, if possible to accurately represent;Optional.empty()
otherwise
-
asShort
public short asShort()Description copied from class:JsonNode
Method similar toJsonNode.shortValue()
but in addition to coercing Number values (same asJsonNode.shortValue()
), will also try to coerce a couple of additional types (or cases):- JSON Floating-point numbers with fractions (ones without fractions
are ok for
JsonNode.shortValue()
) will be truncated toshort
(if (and only if) they fit inshort
range). - JSON Strings that represent JSON Numbers ("stringified" numbers)
- JSON Null (converted to
0
)) - POJO nodes that contain Number values
- Specified by:
asShort
in classNumericNode
- Returns:
short
value this node represents, if possible to accurately represent
- JSON Floating-point numbers with fractions (ones without fractions
are ok for
-
asShort
public short asShort(short defaultValue) Description copied from class:JsonNode
Method similar toJsonNode.shortValue()
, but that will return specifieddefaultValue
if this node cannot be converted toshort
.- Specified by:
asShort
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted toshort
- Returns:
short
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
asShortOpt
Description copied from class:JsonNode
Method similar toJsonNode.asShort()
, but that will return (Optional.empty()
) if this node cannot be coerced toshort
.- Specified by:
asShortOpt
in classNumericNode
- Returns:
Optional<Short>
value this node represents, if possible to accurately represent;Optional.empty()
otherwise
-
intValue
public final int intValue()Description copied from class:JsonNode
Method that will try to access value of this node as a Javaint
: but if node value cannot be expressed exactly as anint
, aJsonNodeException
will be thrown. Access works for following cases:- JSON Integer values that fit in Java 32-bit signed
int
range - JSON Floating-point values that fit in Java 32-bit signed
int
range AND do not have fractional part.
NOTE: for more lenient conversions, use
JsonNode.asInt()
- Specified by:
intValue
in classNumericNode
- Returns:
Int
value this node represents, if possible to accurately represent
- JSON Integer values that fit in Java 32-bit signed
-
intValue
public final int intValue(int defaultValue) Description copied from class:JsonNode
Method similar toJsonNode.intValue()
, but that will return specifieddefaultValue
if this node cannot be converted to Javaint
.- Specified by:
intValue
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted to Javaint
- Returns:
- Java
int
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
intValueOpt
Description copied from class:JsonNode
Method similar toJsonNode.intValue()
, but that will return emptyOptionalInt
(OptionalInt.empty()
) if this node cannot be converted to Javaint
.- Specified by:
intValueOpt
in classNumericNode
- Returns:
- Java
int
value this node represents, asOptionalInt
, if possible to accurately represent;OptionalInt.empty()
otherwise
-
asInt
public int asInt()Description copied from class:JsonNode
Method similar toJsonNode.intValue()
but in addition to coercing Number values (same asJsonNode.intValue()
), will also try to coerce a couple of additional types (or cases):- JSON Floating-point numbers with fractions (ones without fractions
are ok for
JsonNode.intValue()
) will be truncated toint
(if (and only if) they fit inint
range). - JSON Strings that represent JSON Numbers ("stringified" numbers)
- JSON Null (converted to
0
)) - POJO nodes that contain Number values
- Specified by:
asInt
in classNumericNode
- Returns:
int
value this node represents, if possible to accurately represent
- JSON Floating-point numbers with fractions (ones without fractions
are ok for
-
asInt
public int asInt(int defaultValue) Description copied from class:JsonNode
Method similar toJsonNode.intValue()
, but that will return specifieddefaultValue
if this node cannot be converted toint
.- Specified by:
asInt
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted toint
- Returns:
int
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
asIntOpt
Description copied from class:JsonNode
Method similar toJsonNode.asInt()
, but that will return (OptionalInt.empty()
) if this node cannot be coerced toint
.- Specified by:
asIntOpt
in classNumericNode
- Returns:
OptionalInt
value this node represents, if possible to accurately represent;OptionalInt.empty()
otherwise
-
longValue
public final long longValue()Description copied from class:JsonNode
Method that will try to access value of this node as a Javalong
: but if node value cannot be expressed exactly as along
, aJsonNodeException
will be thrown. Access works for following cases:- JSON Integer values that fit in Java 64-bit signed
long
range - JSON Floating-point values that fit in Java 64-bit signed
long
range AND do not have fractional part.
NOTE: for more lenient conversions, use
JsonNode.asLong()
- Specified by:
longValue
in classNumericNode
- Returns:
Long
value this node represents, if possible to accurately represent
- JSON Integer values that fit in Java 64-bit signed
-
longValue
public final long longValue(long defaultValue) Description copied from class:JsonNode
Method similar toJsonNode.longValue()
, but that will return specifieddefaultValue
if this node cannot be converted tolong
.- Specified by:
longValue
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted tolong
- Returns:
long
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
longValueOpt
Description copied from class:JsonNode
Method similar toJsonNode.longValue()
, but that will return emptyOptionalLong
(OptionalLong.empty()
) if this node cannot be converted to Javalong
.- Specified by:
longValueOpt
in classNumericNode
- Returns:
- Java
long
value this node represents, asOptionalLong
, if possible to accurately represent;OptionalLong.empty()
otherwise
-
asLong
public final long asLong()Description copied from class:JsonNode
Method similar toJsonNode.longValue()
but in addition to coercing Number values (same asJsonNode.longValue()
), will also try to coerce a couple of additional types (or cases):- JSON Floating-point numbers with fractions (ones without fractions
are ok for
JsonNode.longValue()
) will be truncated tolong
(if (and only if) they fit inlong
range). - JSON Strings that represent JSON Numbers ("stringified" numbers)
- JSON Null (converted to
0
)) - POJO nodes that contain Number values
- Specified by:
asLong
in classNumericNode
- Returns:
long
value this node represents, if possible to accurately represent
- JSON Floating-point numbers with fractions (ones without fractions
are ok for
-
asLong
public final long asLong(long defaultValue) Description copied from class:JsonNode
Method similar toJsonNode.asLong()
, but that will return specifieddefaultValue
if this node cannot be coerced tolong
(instead of throwing an exception).- Specified by:
asLong
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be coerced tolong
- Returns:
long
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
asLongOpt
Description copied from class:JsonNode
Method similar toJsonNode.asLong()
, but that will return (OptionalLong.empty()
) if this node cannot be coerced tolong
.- Specified by:
asLongOpt
in classNumericNode
- Returns:
OptionalLong
value this node represents (or can be coerced to),OptionalLong.empty()
otherwise
-
bigIntegerValue
Description copied from class:JsonNode
Method that will try to access value of this node as aBigInteger
, but if node value cannot be expressed exactly as aBigInteger
, aJsonNodeException
will be thrown. Access works for following cases:- JSON Integer values
- JSON Floating-point values that do not have fractional part.
- Specified by:
bigIntegerValue
in classNumericNode
- Returns:
BigInteger
value this node represents, if possible to accurately represent
-
bigIntegerValue
Description copied from class:JsonNode
Method similar toJsonNode.bigIntegerValue()
, but that will return specifieddefaultValue
if this node cannot be converted to JavaBigInteger
.- Specified by:
bigIntegerValue
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted to JavaBigInteger
- Returns:
- Java
BigInteger
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
bigIntegerValueOpt
Description copied from class:JsonNode
Method similar toJsonNode.bigIntegerValue()
, but that will return empty (Optional.empty()
) if this node cannot be converted to JavaBigInteger
.- Specified by:
bigIntegerValueOpt
in classNumericNode
- Returns:
- Java
BigInteger
value this node represents, asOptional<BigInteger>
, if possible to accurately represent;Optional.empty()
otherwise
-
asBigInteger
Description copied from class:JsonNode
Method similar toJsonNode.bigIntegerValue()
but in addition to coercing Number values (same asJsonNode.bigIntegerValue()
), will also try to coerce a couple of additional types (or cases):- JSON Floating-point numbers with fractions (ones without fractions
are ok for
JsonNode.bigIntegerValue()
) will be truncated to integer value (like withBigDecimal.toBigInteger()
)) - JSON Strings that represent JSON Numbers ("stringified" numbers)
- JSON Null (converted to
0
)) - POJO nodes that contain Number values
- Specified by:
asBigInteger
in classNumericNode
- Returns:
BigInteger
value this node represents, if possible to accurately convert;defaultValue
otherwise
- JSON Floating-point numbers with fractions (ones without fractions
are ok for
-
asBigInteger
Description copied from class:JsonNode
Method similar toJsonNode.asBigInteger()
, but that will return specifieddefaultValue
if this node cannot be converted toBigInteger
.- Specified by:
asBigInteger
in classNumericNode
- Parameters:
defaultValue
- Value to return if this node cannot be converted toBigInteger
- Returns:
BigInteger
value this node represents, if possible to accurately convert;defaultValue
otherwise
-
asBigIntegerOpt
Description copied from class:JsonNode
Method similar toJsonNode.bigIntegerValue()
, but that will return empty (Optional.empty()
) if this node cannot be converted to JavaBigInteger
.- Specified by:
asBigIntegerOpt
in classNumericNode
- Returns:
BigInteger
value this node represents, asOptional<BigInteger>
, if possible to accurately represent;Optional.empty()
otherwise.
-
decimalValue
Description copied from class:JsonNode
Method that will try to access value of this node as a JavaBigDecimal
: but if node value cannot be expressed exactly as aBigDecimal
, aJsonNodeException
will be thrown. Access works for following cases:- All JSON Number values
NOTE: for more lenient conversions, use
JsonNode.asDecimal()
- Specified by:
decimalValue
in classNumericNode
- Returns:
BigDecimal
value this node represents, if possible to accurately represent
-
decimalValue
Description copied from class:JsonNode
Method similar toJsonNode.decimalValue()
, but that will returndefaultValue
if this node cannot be coerced to JavaBigDecimal
.- Specified by:
decimalValue
in classNumericNode
- Returns:
BigDecimal
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
decimalValueOpt
Description copied from class:JsonNode
Method similar toJsonNode.decimalValue()
, but that will return emptyOptional
(Optional.empty()
) if this node cannot be coerced toBigDecimal
.- Specified by:
decimalValueOpt
in classNumericNode
- Returns:
- Java
BigDecimal
value this node represents, asOptional<BigDecimal>
, if possible to accurately represent;Optional.empty()
otherwise
-
asDecimal
Description copied from class:JsonNode
Method that will try to access value of this node as aBigDecimal
: but if node value cannot be expressed exactly as aBigDecimal
, aJsonNodeException
will be thrown. Access works for following cases:- JSON Floating-point values (but not "NaN" or "Infinity")
- JSON Integer values
- JSON String that represents JSON Numbers ("stringified" numbers)
- JSON Null (converted to
BigDecimal.ZERO
)) - POJO nodes that contain Number values
- Specified by:
asDecimal
in classNumericNode
- Returns:
BigDecimal
value this node represents, if possible to accurately represent
-
asDecimal
Description copied from class:JsonNode
Method similar toJsonNode.asDecimal()
, but that will returndefaultValue
if this node cannot be coerced to JavaBigDecimal
.- Specified by:
asDecimal
in classNumericNode
- Returns:
BigDecimal
value this node represents, if possible to accurately represent;defaultValue
otherwise
-
asDecimalOpt
Description copied from class:JsonNode
Method similar toJsonNode.asDecimal()
, but that will return emptyOptional
(Optional.empty()
) if this node cannot be coerced toBigDecimal
.- Specified by:
asDecimalOpt
in classNumericNode
- Returns:
- Java
BigDecimal
value this node represents, asOptional<BigDecimal>
, if possible to accurately represent;Optional.empty()
otherwise
-
_asShortValueUnchecked
protected abstract short _asShortValueUnchecked()Method for sub-classes to implement; returns the underlying value as ashort
without any checks (wrt NaN or value range), so caller must ensure validity prior to calling -
_asIntValueUnchecked
protected abstract int _asIntValueUnchecked()Method for sub-classes to implement; returns the underlying value as aint
without any checks (wrt NaN or value range), so caller must ensure validity prior to calling -
_asLongValueUnchecked
protected abstract long _asLongValueUnchecked()Method for sub-classes to implement; returns the underlying value as along
without any checks (wrt NaN or value range), so caller must ensure validity prior to calling -
_asBigIntegerValueUnchecked
Method for sub-classes to implement; returns the underlying value as aBigInteger
without any checks (wrt NaN), so caller must ensure validity prior to calling -
_asDecimalValueUnchecked
Method for sub-classes to implement; returns the underlying value as aBigDecimal
without any checks (wrt NaN), so caller must ensure validity prior to calling -
_hasFractionalPart
protected abstract boolean _hasFractionalPart() -
_inShortRange
protected abstract boolean _inShortRange() -
_inIntRange
protected abstract boolean _inIntRange() -
_inLongRange
protected abstract boolean _inLongRange()
-