Class JsonNumber

java.lang.Object
com.oorian.json.JsonValue
com.oorian.json.JsonNumber

public class JsonNumber extends JsonValue
Represents a JSON number value.

JsonNumber wraps a Java Number and supports all numeric types including integers, longs, floats, and doubles.

  • Constructor Details

    • JsonNumber

      public JsonNumber(Number value)
      Creates a new JsonNumber with the specified numeric value.
      Parameters:
      value - the numeric value.
  • Method Details

    • getValue

      public Number getValue()
      Returns the underlying numeric value.
      Returns:
      the Number value.
    • toJsonString

      public String toJsonString()
      Description copied from class: JsonValue
      Returns this value serialized as a JSON string.
      Specified by:
      toJsonString in class JsonValue
      Returns:
      the JSON string representation.