Interface JSONNumber
- All Superinterfaces:
Formattable, JSONValue
- All Known Implementing Classes:
JSONNumberImpl
@ClassVersion(sourceVersion="$Id: JSONNumber.java 1187 2026-04-07 11:01:35Z tquadrat $")
@API(status=STABLE,
since="0.25.0")
public sealed interface JSONNumber
extends JSONValue
permits JSONNumberImpl
The definition of a JSON number.
>- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: JSONNumber.java 1187 2026-04-07 11:01:35Z tquadrat $
- Since:
- 0.25.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.jsonbuilder.JSONNumber"
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value as anBigDecimal.Returns the value as anBigInteger.doubleReturns the value as andouble.floatgetFloat()Returns the value as anfloat.intgetInt()Returns the value as anint.longgetLong()Returns the value as anlong.
-
Method Details
-
getBigDecimal
Returns the value as an
BigDecimal.- Returns:
- The value.
- Throws:
NumberFormatException- The value cannot be parsed to a validBigDecimal.
-
getBigInteger
Returns the value as an
BigInteger.- Returns:
- The value.
- Throws:
NumberFormatException- The value cannot be parsed to a validBigInteger.
-
getDouble
Returns the value as an
double.- Returns:
- The value.
- Throws:
NumberFormatException- The value cannot be parsed to a validdouble.
-
getFloat
Returns the value as an
float.- Returns:
- The value.
- Throws:
NumberFormatException- The value cannot be parsed to a validfloat.
-
getInt
Returns the value as an
int.- Returns:
- The value.
- Throws:
NumberFormatException- The value cannot be parsed to a validint.
-
getLong
Returns the value as an
long.- Returns:
- The value.
- Throws:
NumberFormatException- The value cannot be parsed to a validlong.
-
