Package org.apache.johnzon.core
Class JsonNumberImpl
- java.lang.Object
-
- org.apache.johnzon.core.JsonNumberImpl
-
- All Implemented Interfaces:
jakarta.json.JsonNumber
,jakarta.json.JsonValue
,Serializable
final class JsonNumberImpl extends Object implements jakarta.json.JsonNumber, Serializable
-
-
Field Summary
Fields Modifier and Type Field Description private Integer
hashCode
private Consumer<BigDecimal>
maxBigDecimalScale
private BigDecimal
value
-
Constructor Summary
Constructors Constructor Description JsonNumberImpl(BigDecimal decimal, Consumer<BigDecimal> maxBigDecimalScale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigDecimal
bigDecimalValue()
BigInteger
bigIntegerValue()
BigInteger
bigIntegerValueExact()
private void
checkFractionalPart()
double
doubleValue()
boolean
equals(Object obj)
jakarta.json.JsonValue.ValueType
getValueType()
int
hashCode()
int
intValue()
int
intValueExact()
boolean
isIntegral()
long
longValue()
long
longValueExact()
Number
numberValue()
String
toString()
-
-
-
Field Detail
-
value
private final BigDecimal value
-
hashCode
private transient Integer hashCode
-
maxBigDecimalScale
private transient Consumer<BigDecimal> maxBigDecimalScale
-
-
Constructor Detail
-
JsonNumberImpl
JsonNumberImpl(BigDecimal decimal, Consumer<BigDecimal> maxBigDecimalScale)
-
-
Method Detail
-
numberValue
public Number numberValue()
- Specified by:
numberValue
in interfacejakarta.json.JsonNumber
-
isIntegral
public boolean isIntegral()
- Specified by:
isIntegral
in interfacejakarta.json.JsonNumber
-
intValue
public int intValue()
- Specified by:
intValue
in interfacejakarta.json.JsonNumber
-
intValueExact
public int intValueExact()
- Specified by:
intValueExact
in interfacejakarta.json.JsonNumber
-
longValue
public long longValue()
- Specified by:
longValue
in interfacejakarta.json.JsonNumber
-
longValueExact
public long longValueExact()
- Specified by:
longValueExact
in interfacejakarta.json.JsonNumber
-
bigIntegerValue
public BigInteger bigIntegerValue()
- Specified by:
bigIntegerValue
in interfacejakarta.json.JsonNumber
-
bigIntegerValueExact
public BigInteger bigIntegerValueExact()
- Specified by:
bigIntegerValueExact
in interfacejakarta.json.JsonNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in interfacejakarta.json.JsonNumber
-
bigDecimalValue
public BigDecimal bigDecimalValue()
- Specified by:
bigDecimalValue
in interfacejakarta.json.JsonNumber
-
getValueType
public jakarta.json.JsonValue.ValueType getValueType()
- Specified by:
getValueType
in interfacejakarta.json.JsonValue
-
toString
public String toString()
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
checkFractionalPart
private void checkFractionalPart()
-
-