Class IntegerValue

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

    public class IntegerValue
    extends FieldValue
    A FieldValue instance representing an integer value.
    • Constructor Detail

      • IntegerValue

        public IntegerValue​(int value)
        Creates a new instance.
        Parameters:
        value - the value to use
    • Method Detail

      • getValue

        public int getValue()
        Returns the integer value of this object
        Returns:
        the integer value
      • compareTo

        public int compareTo​(FieldValue other)
      • getLong

        public long getLong()
        Returns a long value for this object.
        Overrides:
        getLong in class FieldValue
        Returns:
        the long value
      • castAsDouble

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

        public java.math.BigDecimal getNumber()
        Returns a BigDecimal value for this object.
        Overrides:
        getNumber in class FieldValue
        Returns:
        the BigDecimal value
      • 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