Package oracle.nosql.driver.values
Class LongValue
- java.lang.Object
-
- oracle.nosql.driver.values.FieldValue
-
- oracle.nosql.driver.values.LongValue
-
- All Implemented Interfaces:
java.lang.Comparable<FieldValue>
public class LongValue extends FieldValue
AFieldValueinstance representing a long value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class oracle.nosql.driver.values.FieldValue
FieldValue.Type
-
-
Constructor Summary
Constructors Constructor Description LongValue(long value)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecastAsDouble()Casts this long to a double, possibly with loss of information about magnitude, precision or sign.intcompareTo(FieldValue other)booleanequals(java.lang.Object other)java.math.BigDecimalgetNumber()Returns a BigDecimal value for this object.FieldValue.TypegetType()Returns the type of the objectlonggetValue()Returns the long value of this objectinthashCode()java.lang.StringtoJson(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, getString, getTimestamp, isAtomic, isJsonNull, isNull, isNumeric, toJson, toString
-
-
-
-
Method Detail
-
getType
public FieldValue.Type getType()
Description copied from class:FieldValueReturns the type of the object- Specified by:
getTypein classFieldValue- Returns:
- the type
-
getValue
public long getValue()
Returns the long value of this object- Returns:
- the long value
-
castAsDouble
public double castAsDouble()
Casts this long to a double, possibly with loss of information about magnitude, precision or sign.- Overrides:
castAsDoublein classFieldValue- Returns:
- a double value
-
compareTo
public int compareTo(FieldValue other)
-
getNumber
public java.math.BigDecimal getNumber()
Returns a BigDecimal value for this object.- Overrides:
getNumberin classFieldValue- Returns:
- the BigDecimal value
-
toJson
public java.lang.String toJson(JsonOptions options)
Description copied from class:FieldValueReturns a JSON representation of the value using the options, if specified.- Specified by:
toJsonin 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
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-