Class JSONDecimal


public class JSONDecimal extends JSONNumber
Represents a JSON float. JSON only defines "numbers" but during parsing a difference is made between integral types and floating types.
  • Field Details

  • Constructor Details

    • JSONDecimal

      public JSONDecimal(BigDecimal value)
  • Method Details

    • getValue

      public BigDecimal getValue()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • render

      protected String render(boolean pretty, String indent)
      Description copied from class: JSONValue
      Convert the JSON value into a string representation (JSON representation).
      Specified by:
      render in class JSONValue
      Parameters:
      pretty - Indicating if the print should be made pretty (human readers) or compact (transmission or storage).
      indent - Starting indent.
      Returns:
      A JSON representation.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • strip

      public Object strip()
      Remove all JSON information. In the case of a JSONDecimal this is a BigDecimal.
      Specified by:
      strip in class JSONValue
      Returns:
      A BigDecimal representing the JSONDecimal.