java.lang.Object
io.helidon.json.JsonValue
io.helidon.json.JsonNumber
Represents a JSON number value.
This module is incubating. These APIs may change in any version of Helidon, including backward incompatible changes.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the BigDecimal value of this JsonNumber.static JsonNumbercreate(double doubleValue) Create a JsonNumber from a double value.static JsonNumbercreate(long longValue) Create a JsonNumber from a long value.static JsonNumbercreate(BigDecimal bigDecimalValue) Create a JsonNumber from a BigDecimal value.doubleReturn the double value of this JsonNumber.intintValue()Return the int value of this JsonNumber.longReturn the long value of this JsonNumber.voidtoJson(JsonGenerator generator) Write this JSON value to the provided generator.type()Return the type of this JSON value.
-
Method Details
-
create
Create a JsonNumber from a BigDecimal value.- Parameters:
bigDecimalValue- the BigDecimal value- Returns:
- a new JsonNumber
-
create
Create a JsonNumber from a double value.- Parameters:
doubleValue- the double value- Returns:
- a new JsonNumber
-
create
Create a JsonNumber from a long value.- Parameters:
longValue- the long value- Returns:
- a new JsonNumber
-
doubleValue
public double doubleValue()Return the double value of this JsonNumber.- Returns:
- the double value
-
intValue
public int intValue()Return the int value of this JsonNumber.- Returns:
- the int value
-
longValue
public long longValue()Return the long value of this JsonNumber.- Returns:
- the long value
-
bigDecimalValue
Return the BigDecimal value of this JsonNumber.- Returns:
- the BigDecimal value
-
type
Description copied from class:JsonValueReturn the type of this JSON value. -
toJson
Description copied from class:JsonValueWrite this JSON value to the provided generator.
-