Top Description Fields Constructors Methods
tools.jackson.databind.node

public Class BigIntegerNode

extends NumericIntNode
Class Inheritance
Imports
java.math.BigDecimal, .BigInteger, java.util.Objects, .Optional, .OptionalDouble, .OptionalInt, .OptionalLong, tools.jackson.core.*, tools.jackson.databind.SerializationContext

Numeric node that contains simple 64-bit integer values.

Field Summary

Modifier and TypeField and Description
protected final BigInteger
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Boolean
_asBoolean()

Overrides tools.jackson.databind.node.BaseJsonNode._asBoolean.

Method sub-classes should override if they can produce boolean values via asBoolean() -- if not, return null (in which case appropriate error will be thrown or default value returned).

protected double
protected float
public int
_asIntValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericNode._asIntValueUnchecked.

Method for sub-classes to implement; returns the underlying value as a int without any checks (wrt NaN or value range), so caller must ensure validity prior to calling

public long
_asLongValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericNode._asLongValueUnchecked.

Method for sub-classes to implement; returns the underlying value as a long without any checks (wrt NaN or value range), so caller must ensure validity prior to calling

public short
_asShortValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericNode._asShortValueUnchecked.

Method for sub-classes to implement; returns the underlying value as a short without any checks (wrt NaN or value range), so caller must ensure validity prior to calling

public String
_asString()

Implements abstract tools.jackson.databind.node.NumericNode._asString.

Method sub-classes should override if they can produce String values via asString() -- if not, return null (in which case appropriate error will be thrown or default value returned).

public double
asDouble()

Overrides tools.jackson.databind.node.NumericIntNode.asDouble.

Method similar to doubleValue() but in addition to coercing Number values will also try coerce couple of additional types:

  • JSON String that represents JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0.0d)
  • POJO nodes that contain Number values
public double
asDouble(double defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.asDouble.

Method similar to asDouble(), but that will return defaultValue if this node cannot be coerced to double.

public OptionalDouble
asDoubleOpt()

Overrides tools.jackson.databind.node.NumericIntNode.asDoubleOpt.

Method similar to asDouble(), but that will return (OptionalDouble.empty()) if this node cannot be coerced to double.

public float
asFloat()

Overrides tools.jackson.databind.node.NumericIntNode.asFloat.

Method similar to floatValue() but in addition to coercing Number values will also try coerce couple of additional types:

  • JSON String that represents JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0.0f)
  • POJO nodes that contain Number values
public float
asFloat(float defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.asFloat.

Method similar to asFloat(), but that will return defaultValue if this node cannot be coerced to float.

public Optional<Float>
asFloatOpt()

Overrides tools.jackson.databind.node.NumericIntNode.asFloatOpt.

Method similar to asFloat(), but that will return (Optional.empty()) if this node cannot be coerced to float.

public int
asInt()

Implements abstract tools.jackson.databind.node.NumericNode.asInt.

Method similar to intValue() but in addition to coercing Number values (same as 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 intValue()) will be truncated to int (if (and only if) they fit in int range).
  • JSON Strings that represent JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0))
  • POJO nodes that contain Number values
public int
asInt(int defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.asInt.

Method similar to intValue(), but that will return specified defaultValue if this node cannot be converted to int.

public OptionalInt
asIntOpt()

Implements abstract tools.jackson.databind.node.NumericNode.asIntOpt.

Method similar to asInt(), but that will return (OptionalInt.empty()) if this node cannot be coerced to int.

public long
asLong()

Implements abstract tools.jackson.databind.node.NumericNode.asLong.

Method similar to longValue() but in addition to coercing Number values (same as 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 longValue()) will be truncated to long (if (and only if) they fit in long range).
  • JSON Strings that represent JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0))
  • POJO nodes that contain Number values
public long
asLong(long defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.asLong.

Method similar to asLong(), but that will return specified defaultValue if this node cannot be coerced to long (instead of throwing an exception).

public OptionalLong
asLongOpt()

Implements abstract tools.jackson.databind.node.NumericNode.asLongOpt.

Method similar to asLong(), but that will return (OptionalLong.empty()) if this node cannot be coerced to long.

public short
asShort()

Implements abstract tools.jackson.databind.node.NumericNode.asShort.

Method similar to shortValue() but in addition to coercing Number values (same as 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 shortValue()) will be truncated to short (if (and only if) they fit in short range).
  • JSON Strings that represent JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0))
  • POJO nodes that contain Number values
public short
asShort(short defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.asShort.

Method similar to shortValue(), but that will return specified defaultValue if this node cannot be converted to short.

public Optional<Short>
asShortOpt()

Implements abstract tools.jackson.databind.node.NumericNode.asShortOpt.

Method similar to asShort(), but that will return (Optional.empty()) if this node cannot be coerced to short.

public BigInteger
bigIntegerValue()

Implements abstract tools.jackson.databind.node.NumericIntNode.bigIntegerValue.

Method that will try to access value of this node as a BigInteger, but if node value cannot be expressed exactly as a BigInteger, a JsonNodeException will be thrown.

public BigInteger
bigIntegerValue(BigInteger defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.bigIntegerValue.

Method similar to bigIntegerValue(), but that will return specified defaultValue if this node cannot be converted to Java BigInteger.

public Optional<BigInteger>
bigIntegerValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.bigIntegerValueOpt.

Method similar to bigIntegerValue(), but that will return empty (Optional.empty()) if this node cannot be converted to Java BigInteger.

public BigDecimal
decimalValue()

Implements abstract tools.jackson.databind.node.NumericNode.decimalValue.

Method that will try to access value of this node as a Java BigDecimal: but if node value cannot be expressed exactly as a BigDecimal, a JsonNodeException will be thrown.

public BigDecimal
decimalValue(BigDecimal defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.decimalValue.

Method similar to decimalValue(), but that will return defaultValue if this node cannot be coerced to Java BigDecimal.

public Optional<BigDecimal>
decimalValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.decimalValueOpt.

Method similar to decimalValue(), but that will return empty Optional (Optional.empty()) if this node cannot be coerced to BigDecimal.

public double
doubleValue()

Overrides tools.jackson.databind.node.NumericIntNode.doubleValue.

Method that will try to access value of this node as a double: but if node value cannot be expressed exactly as a double, a JsonNodeException will be thrown.

public double
doubleValue(double defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.doubleValue.

Method similar to doubleValue(), but that will return specified defaultValue if this node cannot be converted to double.

public OptionalDouble
doubleValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.doubleValueOpt.

Method similar to doubleValue(), but that will return empty OptionalLong (OptionalDouble.empty()) if this node cannot be converted to Java double.

public boolean
equals(Object o)

Implements abstract tools.jackson.databind.JsonNode.equals.

Equality for node objects is defined as full (deep) value equality.

public float
floatValue()

Overrides tools.jackson.databind.node.NumericIntNode.floatValue.

Method that will try to access value of this node as a Java float: but if node value cannot be expressed exactly as a float, a JsonNodeException will be thrown.

public float
floatValue(float defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.floatValue.

Method similar to floatValue(), but that will return specified defaultValue if this node cannot be converted to float.

public Optional<Float>
floatValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.floatValueOpt.

Method similar to floatValue(), but that will return empty Optional<Float> (Optional.empty()) if this node cannot be converted to Java float.

public int
hashCode()

Implements abstract tools.jackson.databind.node.BaseJsonNode.hashCode.

Returns a hash code value for this object.

public boolean
inIntRange()

Implements abstract tools.jackson.databind.node.NumericNode.inIntRange.

Method that can be used to determine whether this numeric value's in part fits within Java 32-bitint type.

public boolean
inLongRange()

Implements abstract tools.jackson.databind.node.NumericNode.inLongRange.

Method that can be used to determine whether this numeric value's in part fits within Java 64-bit long type.

public boolean
inShortRange()

Implements abstract tools.jackson.databind.node.NumericNode.inShortRange.

Method that can be used to determine whether this numeric value's in part fits within Java 16-bit short type.

public int
intValue()

Implements abstract tools.jackson.databind.node.NumericNode.intValue.

Method that will try to access value of this node as a Java int: but if node value cannot be expressed exactly as an int, a JsonNodeException will be thrown.

public int
intValue(int defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.intValue.

Method similar to intValue(), but that will return specified defaultValue if this node cannot be converted to Java int.

public OptionalInt
intValueOpt()

Implements abstract tools.jackson.databind.node.NumericNode.intValueOpt.

Method similar to intValue(), but that will return empty OptionalInt (OptionalInt.empty()) if this node cannot be converted to Java int.

public boolean
public long
longValue()

Implements abstract tools.jackson.databind.node.NumericNode.longValue.

Method that will try to access value of this node as a Java long: but if node value cannot be expressed exactly as a long, a JsonNodeException will be thrown.

public long
longValue(long defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.longValue.

Method similar to longValue(), but that will return specified defaultValue if this node cannot be converted to long.

public OptionalLong
longValueOpt()

Implements abstract tools.jackson.databind.node.NumericNode.longValueOpt.

Method similar to longValue(), but that will return empty OptionalLong (OptionalLong.empty()) if this node cannot be converted to Java long.

public JsonParser.NumberType
numberType()

Implements abstract tools.jackson.databind.node.NumericNode.numberType.

Implements tools.jackson.core.TreeNode.numberType.

Returns code that identifies type of underlying numeric value, if (and only if) node is a number node.

public Number
numberValue()

Implements abstract tools.jackson.databind.node.NumericNode.numberValue.

Method that will try to access value of this node as Number that accurately represents its value, if (and only if) this is a number node (returns true for isNumber).

public final void
serialize(JsonGenerator g, SerializationContext provider)

Implements abstract tools.jackson.databind.node.BaseJsonNode.serialize.

Implements tools.jackson.databind.JacksonSerializable.serialize.

Method called to serialize node instances using given generator.

public short
shortValue()

Implements abstract tools.jackson.databind.node.NumericNode.shortValue.

Method that will try to access value of this node as 16-bit signed integer value (Java short): but if node value cannot be expressed exactly as a short, a JsonNodeException will be thrown.

public short
shortValue(short defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.shortValue.

Method similar to shortValue(), but that will return specified defaultValue if this node cannot be converted to Java short.

public Optional<Short>
shortValueOpt()

Implements abstract tools.jackson.databind.node.NumericNode.shortValueOpt.

Method similar to shortValue(), but that will return empty Optional<Short> (Optional.empty()) if this node cannot be converted to Java short.

public static BigIntegerNode
Inherited from tools.jackson.databind.node.NumericIntNode:
asBigIntegerasBigIntegerasBigIntegerOptasDecimalasDecimalasDecimalOptasTokencanConvertToIntcanConvertToLongcanConvertToShorthasFractionalPartisIntegralNumberisNaN

Field Detail

_valueback to summary
protected final BigInteger _value
serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.node.NumericIntNode.serialVersionUID.

Constructor Detail

BigIntegerNodeback to summary
public BigIntegerNode(BigInteger v)

Method Detail

_asBooleanback to summary
protected Boolean _asBoolean()

Overrides tools.jackson.databind.node.BaseJsonNode._asBoolean.

Doc from tools.jackson.databind.node.BaseJsonNode._asBoolean.

Method sub-classes should override if they can produce boolean values via asBoolean() -- if not, return null (in which case appropriate error will be thrown or default value returned).

Annotations
@Override
_asDoubleValueUncheckedback to summary
protected double _asDoubleValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericIntNode._asDoubleValueUnchecked.

Annotations
@Override
_asFloatValueUncheckedback to summary
protected float _asFloatValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericIntNode._asFloatValueUnchecked.

Annotations
@Override
_asIntValueUncheckedback to summary
public int _asIntValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericNode._asIntValueUnchecked.

Doc from tools.jackson.databind.node.NumericNode._asIntValueUnchecked.

Method for sub-classes to implement; returns the underlying value as a int without any checks (wrt NaN or value range), so caller must ensure validity prior to calling

Annotations
@Override
_asLongValueUncheckedback to summary
public long _asLongValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericNode._asLongValueUnchecked.

Doc from tools.jackson.databind.node.NumericNode._asLongValueUnchecked.

Method for sub-classes to implement; returns the underlying value as a long without any checks (wrt NaN or value range), so caller must ensure validity prior to calling

Annotations
@Override
_asShortValueUncheckedback to summary
public short _asShortValueUnchecked()

Implements abstract tools.jackson.databind.node.NumericNode._asShortValueUnchecked.

Doc from tools.jackson.databind.node.NumericNode._asShortValueUnchecked.

Method for sub-classes to implement; returns the underlying value as a short without any checks (wrt NaN or value range), so caller must ensure validity prior to calling

Annotations
@Override
_asStringback to summary
public String _asString()

Implements abstract tools.jackson.databind.node.NumericNode._asString.

Doc from tools.jackson.databind.node.BaseJsonNode._asString.

Method sub-classes should override if they can produce String values via asString() -- if not, return null (in which case appropriate error will be thrown or default value returned).

Annotations
@Override
asDoubleback to summary
public double asDouble()

Overrides tools.jackson.databind.node.NumericIntNode.asDouble.

Doc from tools.jackson.databind.JsonNode.asDouble.

Method similar to doubleValue() but in addition to coercing Number values will also try coerce couple of additional types:

  • JSON String that represents JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0.0d)
  • POJO nodes that contain Number values

Annotations
@Override
asDoubleback to summary
public double asDouble(double defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.asDouble.

Doc from tools.jackson.databind.JsonNode.asDouble.

Method similar to asDouble(), but that will return defaultValue if this node cannot be coerced to double.

Annotations
@Override
asDoubleOptback to summary
public OptionalDouble asDoubleOpt()

Overrides tools.jackson.databind.node.NumericIntNode.asDoubleOpt.

Doc from tools.jackson.databind.JsonNode.asDoubleOpt.

Method similar to asDouble(), but that will return (OptionalDouble.empty()) if this node cannot be coerced to double.

Annotations
@Override
asFloatback to summary
public float asFloat()

Overrides tools.jackson.databind.node.NumericIntNode.asFloat.

Doc from tools.jackson.databind.JsonNode.asFloat.

Method similar to floatValue() but in addition to coercing Number values will also try coerce couple of additional types:

  • JSON String that represents JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0.0f)
  • POJO nodes that contain Number values

Annotations
@Override
asFloatback to summary
public float asFloat(float defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.asFloat.

Doc from tools.jackson.databind.JsonNode.asFloat.

Method similar to asFloat(), but that will return defaultValue if this node cannot be coerced to float.

Annotations
@Override
asFloatOptback to summary
public Optional<Float> asFloatOpt()

Overrides tools.jackson.databind.node.NumericIntNode.asFloatOpt.

Doc from tools.jackson.databind.JsonNode.asFloatOpt.

Method similar to asFloat(), but that will return (Optional.empty()) if this node cannot be coerced to float.

Annotations
@Override
asIntback to summary
public int asInt()

Implements abstract tools.jackson.databind.node.NumericNode.asInt.

Doc from tools.jackson.databind.JsonNode.asInt.

Method similar to intValue() but in addition to coercing Number values (same as 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 intValue()) will be truncated to int (if (and only if) they fit in int range).
  • JSON Strings that represent JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0))
  • POJO nodes that contain Number values
Annotations
@Override
asIntback to summary
public int asInt(int defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.asInt.

Doc from tools.jackson.databind.JsonNode.asInt.

Method similar to intValue(), but that will return specified defaultValue if this node cannot be converted to int.

Annotations
@Override
asIntOptback to summary
public OptionalInt asIntOpt()

Implements abstract tools.jackson.databind.node.NumericNode.asIntOpt.

Doc from tools.jackson.databind.JsonNode.asIntOpt.

Method similar to asInt(), but that will return (OptionalInt.empty()) if this node cannot be coerced to int.

Annotations
@Override
asLongback to summary
public long asLong()

Implements abstract tools.jackson.databind.node.NumericNode.asLong.

Doc from tools.jackson.databind.JsonNode.asLong.

Method similar to longValue() but in addition to coercing Number values (same as 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 longValue()) will be truncated to long (if (and only if) they fit in long range).
  • JSON Strings that represent JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0))
  • POJO nodes that contain Number values
Annotations
@Override
asLongback to summary
public long asLong(long defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.asLong.

Doc from tools.jackson.databind.JsonNode.asLong.

Method similar to asLong(), but that will return specified defaultValue if this node cannot be coerced to long (instead of throwing an exception).

Annotations
@Override
asLongOptback to summary
public OptionalLong asLongOpt()

Implements abstract tools.jackson.databind.node.NumericNode.asLongOpt.

Doc from tools.jackson.databind.JsonNode.asLongOpt.

Method similar to asLong(), but that will return (OptionalLong.empty()) if this node cannot be coerced to long.

Annotations
@Override
asShortback to summary
public short asShort()

Implements abstract tools.jackson.databind.node.NumericNode.asShort.

Doc from tools.jackson.databind.JsonNode.asShort.

Method similar to shortValue() but in addition to coercing Number values (same as 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 shortValue()) will be truncated to short (if (and only if) they fit in short range).
  • JSON Strings that represent JSON Numbers ("stringified" numbers)
  • JSON Null (converted to 0))
  • POJO nodes that contain Number values
Annotations
@Override
asShortback to summary
public short asShort(short defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.asShort.

Doc from tools.jackson.databind.JsonNode.asShort.

Method similar to shortValue(), but that will return specified defaultValue if this node cannot be converted to short.

Annotations
@Override
asShortOptback to summary
public Optional<Short> asShortOpt()

Implements abstract tools.jackson.databind.node.NumericNode.asShortOpt.

Doc from tools.jackson.databind.JsonNode.asShortOpt.

Method similar to asShort(), but that will return (Optional.empty()) if this node cannot be coerced to short.

Annotations
@Override
bigIntegerValueback to summary
public BigInteger bigIntegerValue()

Implements abstract tools.jackson.databind.node.NumericIntNode.bigIntegerValue.

Doc from tools.jackson.databind.JsonNode.bigIntegerValue.

Method that will try to access value of this node as a BigInteger, but if node value cannot be expressed exactly as a BigInteger, a JsonNodeException will be thrown. Access works for following cases:

  • JSON Integer values
  • JSON Floating-point values that do not have fractional part.

Annotations
@Override
bigIntegerValueback to summary
public BigInteger bigIntegerValue(BigInteger defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.bigIntegerValue.

Doc from tools.jackson.databind.JsonNode.bigIntegerValue.

Method similar to bigIntegerValue(), but that will return specified defaultValue if this node cannot be converted to Java BigInteger.

Annotations
@Override
bigIntegerValueOptback to summary
public Optional<BigInteger> bigIntegerValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.bigIntegerValueOpt.

Doc from tools.jackson.databind.JsonNode.bigIntegerValueOpt.

Method similar to bigIntegerValue(), but that will return empty (Optional.empty()) if this node cannot be converted to Java BigInteger.

Annotations
@Override
decimalValueback to summary
public BigDecimal decimalValue()

Implements abstract tools.jackson.databind.node.NumericNode.decimalValue.

Doc from tools.jackson.databind.JsonNode.decimalValue.

Method that will try to access value of this node as a Java BigDecimal: but if node value cannot be expressed exactly as a BigDecimal, a JsonNodeException will be thrown. Access works for following cases:

  • All JSON Number values

Note

for more lenient conversions, use asDecimal()

Annotations
@Override
decimalValueback to summary
public BigDecimal decimalValue(BigDecimal defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.decimalValue.

Doc from tools.jackson.databind.JsonNode.decimalValue.

Method similar to decimalValue(), but that will return defaultValue if this node cannot be coerced to Java BigDecimal.

Annotations
@Override
decimalValueOptback to summary
public Optional<BigDecimal> decimalValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.decimalValueOpt.

Doc from tools.jackson.databind.JsonNode.decimalValueOpt.

Method similar to decimalValue(), but that will return empty Optional (Optional.empty()) if this node cannot be coerced to BigDecimal.

Annotations
@Override
doubleValueback to summary
public double doubleValue()

Overrides tools.jackson.databind.node.NumericIntNode.doubleValue.

Doc from tools.jackson.databind.JsonNode.doubleValue.

Method that will try to access value of this node as a double: but if node value cannot be expressed exactly as a double, a JsonNodeException will be thrown. Access works for following cases:

  • JSON Floating-point values that fit in Java 64-bit double range
  • JSON Integer values that fit in Java 64-bit double range

Note

for more lenient conversions, use asDouble()

Annotations
@Override
doubleValueback to summary
public double doubleValue(double defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.doubleValue.

Doc from tools.jackson.databind.JsonNode.doubleValue.

Method similar to doubleValue(), but that will return specified defaultValue if this node cannot be converted to double.

Annotations
@Override
doubleValueOptback to summary
public OptionalDouble doubleValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.doubleValueOpt.

Doc from tools.jackson.databind.JsonNode.doubleValueOpt.

Method similar to doubleValue(), but that will return empty OptionalLong (OptionalDouble.empty()) if this node cannot be converted to Java double.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Implements abstract tools.jackson.databind.JsonNode.equals.

Doc from tools.jackson.databind.JsonNode.equals.

Equality for node objects is defined as full (deep) value equality. This means that it is possible to compare complete JSON trees for equality by comparing equality of root nodes.

Note

marked as abstract to ensure all implementation classes define it properly and not rely on definition from java.lang.Object.

Annotations
@Override
floatValueback to summary
public float floatValue()

Overrides tools.jackson.databind.node.NumericIntNode.floatValue.

Doc from tools.jackson.databind.JsonNode.floatValue.

Method that will try to access value of this node as a Java float: but if node value cannot be expressed exactly as a float, a JsonNodeException will be thrown. Access works for following cases:

  • JSON Floating-point values that fit in Java 32-bit double range
  • JSON Integer values that fit in Java 32-bit double range

Annotations
@Override
floatValueback to summary
public float floatValue(float defaultValue)

Overrides tools.jackson.databind.node.NumericIntNode.floatValue.

Doc from tools.jackson.databind.JsonNode.floatValue.

Method similar to floatValue(), but that will return specified defaultValue if this node cannot be converted to float.

Annotations
@Override
floatValueOptback to summary
public Optional<Float> floatValueOpt()

Overrides tools.jackson.databind.node.NumericIntNode.floatValueOpt.

Doc from tools.jackson.databind.JsonNode.floatValueOpt.

Method similar to floatValue(), but that will return empty Optional<Float> (Optional.empty()) if this node cannot be converted to Java float.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract tools.jackson.databind.node.BaseJsonNode.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
inIntRangeback to summary
public boolean inIntRange()

Implements abstract tools.jackson.databind.node.NumericNode.inIntRange.

Doc from tools.jackson.databind.node.NumericNode.inIntRange.

Method that can be used to determine whether this numeric value's in part fits within Java 32-bitint type.

Annotations
@Override
inLongRangeback to summary
public boolean inLongRange()

Implements abstract tools.jackson.databind.node.NumericNode.inLongRange.

Doc from tools.jackson.databind.node.NumericNode.inLongRange.

Method that can be used to determine whether this numeric value's in part fits within Java 64-bit long type.

Annotations
@Override
inShortRangeback to summary
public boolean inShortRange()

Implements abstract tools.jackson.databind.node.NumericNode.inShortRange.

Doc from tools.jackson.databind.node.NumericNode.inShortRange.

Method that can be used to determine whether this numeric value's in part fits within Java 16-bit short type.

Annotations
@Override
intValueback to summary
public int intValue()

Implements abstract tools.jackson.databind.node.NumericNode.intValue.

Doc from tools.jackson.databind.JsonNode.intValue.

Method that will try to access value of this node as a Java int: but if node value cannot be expressed exactly as an int, a JsonNodeException 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 asInt()

Annotations
@Override
intValueback to summary
public int intValue(int defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.intValue.

Doc from tools.jackson.databind.JsonNode.intValue.

Method similar to intValue(), but that will return specified defaultValue if this node cannot be converted to Java int.

Annotations
@Override
intValueOptback to summary
public OptionalInt intValueOpt()

Implements abstract tools.jackson.databind.node.NumericNode.intValueOpt.

Doc from tools.jackson.databind.JsonNode.intValueOpt.

Method similar to intValue(), but that will return empty OptionalInt (OptionalInt.empty()) if this node cannot be converted to Java int.

Annotations
@Override
isBigIntegerback to summary
public boolean isBigInteger()

Overrides tools.jackson.databind.JsonNode.isBigInteger.

Annotations
@Override
longValueback to summary
public long longValue()

Implements abstract tools.jackson.databind.node.NumericNode.longValue.

Doc from tools.jackson.databind.JsonNode.longValue.

Method that will try to access value of this node as a Java long: but if node value cannot be expressed exactly as a long, a JsonNodeException 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 asLong()

Annotations
@Override
longValueback to summary
public long longValue(long defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.longValue.

Doc from tools.jackson.databind.JsonNode.longValue.

Method similar to longValue(), but that will return specified defaultValue if this node cannot be converted to long.

Annotations
@Override
longValueOptback to summary
public OptionalLong longValueOpt()

Implements abstract tools.jackson.databind.node.NumericNode.longValueOpt.

Doc from tools.jackson.databind.JsonNode.longValueOpt.

Method similar to longValue(), but that will return empty OptionalLong (OptionalLong.empty()) if this node cannot be converted to Java long.

Annotations
@Override
numberTypeback to summary
public JsonParser.NumberType numberType()

Implements abstract tools.jackson.databind.node.NumericNode.numberType.

Implements tools.jackson.core.TreeNode.numberType.

Doc from tools.jackson.databind.node.BaseJsonNode.numberType.

Returns code that identifies type of underlying numeric value, if (and only if) node is a number node.

Annotations
@Override
numberValueback to summary
public Number numberValue()

Implements abstract tools.jackson.databind.node.NumericNode.numberValue.

Doc from tools.jackson.databind.JsonNode.numberValue.

Method that will try to access value of this node as Number that accurately represents its value, if (and only if) this is a number node (returns true for isNumber). If this node is NOT a number node, a JsonNodeException will be thrown.

Annotations
@Override
serializeback to summary
public final void serialize(JsonGenerator g, SerializationContext provider) throws JacksonException

Implements abstract tools.jackson.databind.node.BaseJsonNode.serialize.

Implements tools.jackson.databind.JacksonSerializable.serialize.

Doc from tools.jackson.databind.node.BaseJsonNode.serialize.

Method called to serialize node instances using given generator.

Annotations
@Override
shortValueback to summary
public short shortValue()

Implements abstract tools.jackson.databind.node.NumericNode.shortValue.

Doc from tools.jackson.databind.JsonNode.shortValue.

Method that will try to access value of this node as 16-bit signed integer value (Java short): but if node value cannot be expressed exactly as a short, a JsonNodeException 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.

Annotations
@Override
shortValueback to summary
public short shortValue(short defaultValue)

Implements abstract tools.jackson.databind.node.NumericNode.shortValue.

Doc from tools.jackson.databind.JsonNode.shortValue.

Method similar to shortValue(), but that will return specified defaultValue if this node cannot be converted to Java short.

Annotations
@Override
shortValueOptback to summary
public Optional<Short> shortValueOpt()

Implements abstract tools.jackson.databind.node.NumericNode.shortValueOpt.

Doc from tools.jackson.databind.JsonNode.shortValueOpt.

Method similar to shortValue(), but that will return empty Optional<Short> (Optional.empty()) if this node cannot be converted to Java short.

Annotations
@Override
valueOfback to summary
public static BigIntegerNode valueOf(BigInteger v)