Class Numeric

java.lang.Object
java.lang.Number
io.vertx.sqlclient.data.Numeric
All Implemented Interfaces:
Serializable

public final class Numeric extends Number
An arbitrary number that supports NaN.
See Also:
  • Field Details

    • NaN

      public static final Numeric NaN
      Constant for the NaN value.
  • Method Details

    • create

      public static Numeric create(Number number)
      Return a Numeric instance for the given number.

      Null values or infinite Double or Float are rejected.

      Parameters:
      number - the number
      Returns:
      the Numeric value
      Throws:
      NumberFormatException - when the number is infinite
    • parse

      public static Numeric parse(String s)
      Parse and return a Numeric instance for the given s.

      The string "Nan" will return the NaN instance.

      Parameters:
      s - the string
      Returns:
      the Numeric value
    • shortValue

      public short shortValue()
      Overrides:
      shortValue in class Number
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number
    • isNaN

      public boolean isNaN()
      Returns:
      true when this number represents NaN
    • bigDecimalValue

      public BigDecimal bigDecimalValue()
      Returns:
      the numeric value represented by this object after conversion to type BigDecimal. It can be null when this instance represents the NaN value.
    • bigIntegerValue

      public BigInteger bigIntegerValue()
      Returns:
      the numeric value represented by this object after conversion to type BigInteger. It can be null when this instance represents the NaN value.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object