Class JsonNumber

java.lang.Object
io.helidon.json.JsonValue
io.helidon.json.JsonNumber

public final class JsonNumber extends JsonValue
Represents a JSON number value.

This module is incubating. These APIs may change in any version of Helidon, including backward incompatible changes.

  • Method Details

    • create

      public static JsonNumber create(BigDecimal bigDecimalValue)
      Create a JsonNumber from a BigDecimal value.
      Parameters:
      bigDecimalValue - the BigDecimal value
      Returns:
      a new JsonNumber
    • create

      public static JsonNumber create(double doubleValue)
      Create a JsonNumber from a double value.
      Parameters:
      doubleValue - the double 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
    • bigDecimalValue

      public BigDecimal bigDecimalValue()
      Return the BigDecimal value of this JsonNumber.
      Returns:
      the BigDecimal value
    • type

      public JsonValueType type()
      Description copied from class: JsonValue
      Return the type of this JSON value.
      Specified by:
      type in class JsonValue
      Returns:
      the JsonValueType of this value
    • toJson

      public void toJson(JsonGenerator generator)
      Description copied from class: JsonValue
      Write this JSON value to the provided generator.
      Specified by:
      toJson in class JsonValue
      Parameters:
      generator - the generator to write to