Class JsonNumber

java.lang.Object
com.itextpdf.commons.json.JsonValue
com.itextpdf.commons.json.JsonNumber

public final class JsonNumber extends JsonValue
Class representing JSON number value.
  • Constructor Details

    • JsonNumber

      public JsonNumber (double value)
      Creates a new JsonNumber representing a provided value.
      Parameters:
      value - to wrap into this JsonNumber
    • JsonNumber

      public JsonNumber (long value)
      Creates a new JsonNumber representing a provided value.
      Parameters:
      value - to wrap into this JsonNumber
  • Method Details

    • getValue

      public double getValue()
      Gets a double value wrapped into this JsonNumber.
      Returns:
      a double value
    • getDoubleValue

      public double getDoubleValue()
      Gets a double value wrapped into this JsonNumber.
      Returns:
      a double value
    • getLongValue

      public long getLongValue()
      Gets a long value wrapped into this JsonNumber.
      Returns:
      a long value
    • isDouble

      public boolean isDouble()
      Checks if this JsonNumber represents double value
      Returns:
      true if this JsonNumber represents double value, false if it represents long value
    • equals

      public boolean equals (Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object