Class DoubleValue

java.lang.Object
oracle.nosql.driver.values.FieldValue
oracle.nosql.driver.values.DoubleValue
All Implemented Interfaces:
Comparable<FieldValue>

public class DoubleValue extends FieldValue
A FieldValue instance representing a double value.
  • Constructor Details

    • DoubleValue

      public DoubleValue(double value)
      Creates a new instance.
      Parameters:
      value - the value to use
    • DoubleValue

      public DoubleValue(String value)
      Creates a new instance from a String value
      Parameters:
      value - the value to use
      Throws:
      NumberFormatException - if the value is not a valid double
  • Method Details

    • getType

      public FieldValue.Type getType()
      Description copied from class: FieldValue
      Returns the type of the object
      Specified by:
      getType in class FieldValue
      Returns:
      the type
    • getValue

      public double getValue()
      Returns the double value of this object
      Returns:
      the double value
    • castAsDouble

      public double castAsDouble()
      Returns the double value of this object
      Overrides:
      castAsDouble in class FieldValue
      Returns:
      the double value
    • compareTo

      public int compareTo(FieldValue other)
    • getNumber

      public BigDecimal getNumber()
      Returns a BigDecimal value for this object
      Overrides:
      getNumber in class FieldValue
      Returns:
      the BigDecimal value
    • getString

      public String getString()
      Description copied from class: FieldValue
      Returns a String value for the field. The String value cannot be created for MapValue, ArrayValue and BinaryValue. String values that are coerced use Java rules for representation.
      Overrides:
      getString in class FieldValue
      Returns:
      a String value
    • toJson

      public 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(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object