Class NumberValue

  • All Implemented Interfaces:
    java.lang.Comparable<FieldValue>

    public class NumberValue
    extends FieldValue
    A FieldValue instance representing an arbitrary-precision numeric value.
    • Constructor Detail

      • NumberValue

        public NumberValue​(java.math.BigDecimal value)
        Creates a new instance.
        Parameters:
        value - the value to use
    • Method Detail

      • getValue

        public java.math.BigDecimal getValue()
        Returns the number value of this object
        Returns:
        the number value
      • castAsDouble

        public double castAsDouble()
        Casts this number to a double, possibly with loss of information about magnitude, precision or sign.
        Overrides:
        castAsDouble in class FieldValue
        Returns:
        a double value
      • compareTo

        public int compareTo​(FieldValue other)
      • toJson

        public java.lang.String toJson​(JsonOptions options)
        Description copied from class: FieldValue
        Returns a JSON representation of the value using the options, if specified.
        Overrides:
        toJson in class FieldValue
        Parameters:
        options - configurable options used to affect the JSON output format of some data types. May be null.
        Returns:
        the JSON representation of this value.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object