Package oracle.nosql.driver.values
Class DoubleValue
java.lang.Object
oracle.nosql.driver.values.FieldValue
oracle.nosql.driver.values.DoubleValue
- All Implemented Interfaces:
Comparable<FieldValue>
A
FieldValue
instance representing a double value.-
Nested Class Summary
Nested classes/interfaces inherited from class oracle.nosql.driver.values.FieldValue
FieldValue.Type
-
Constructor Summary
ConstructorDescriptionDoubleValue
(double value) Creates a new instance.DoubleValue
(String value) Creates a new instance from a String value -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the double value of this objectint
compareTo
(FieldValue other) boolean
Returns a BigDecimal value for this objectReturns a String value for the field.getType()
Returns the type of the objectdouble
getValue()
Returns the double value of this objectint
hashCode()
toJson
(JsonOptions options) Returns a JSON representation of the value using the options, if specified.Methods inherited from class oracle.nosql.driver.values.FieldValue
asArray, asBinary, asBoolean, asDouble, asInteger, asJsonNull, asLong, asMap, asNull, asNumber, asString, asTimestamp, createFromJson, createFromJson, createFromJson, getBinary, getBoolean, getDouble, getInt, getLong, getSerializedSize, getTimestamp, isAnyNull, isArray, isAtomic, isBinary, isBoolean, isDouble, isInteger, isJsonNull, isLong, isMap, isNull, isNumber, isNumeric, isString, isTimestamp, toJson, toString
-
Constructor Details
-
DoubleValue
public DoubleValue(double value) Creates a new instance.- Parameters:
value
- the value to use
-
DoubleValue
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
Description copied from class:FieldValue
Returns the type of the object- Specified by:
getType
in classFieldValue
- 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 classFieldValue
- Returns:
- the double value
-
compareTo
-
getNumber
Returns a BigDecimal value for this object- Overrides:
getNumber
in classFieldValue
- Returns:
- the BigDecimal value
-
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 classFieldValue
- Returns:
- a String value
-
toJson
Description copied from class:FieldValue
Returns a JSON representation of the value using the options, if specified.- Overrides:
toJson
in classFieldValue
- 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
-
hashCode
public int hashCode()
-