Package oracle.nosql.driver.values
Class IntegerValue
- java.lang.Object
-
- oracle.nosql.driver.values.FieldValue
-
- oracle.nosql.driver.values.IntegerValue
-
- All Implemented Interfaces:
java.lang.Comparable<FieldValue>
public class IntegerValue extends FieldValue
AFieldValue
instance representing an integer value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class oracle.nosql.driver.values.FieldValue
FieldValue.Type
-
-
Constructor Summary
Constructors Constructor Description IntegerValue(int value)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
castAsDouble()
Casts this integer to a double, possibly with loss of information about magnitude, precision or sign.int
compareTo(FieldValue other)
boolean
equals(java.lang.Object other)
long
getLong()
Returns a long value for this object.java.math.BigDecimal
getNumber()
Returns a BigDecimal value for this object.FieldValue.Type
getType()
Returns the type of the objectint
getValue()
Returns the integer value of this objectint
hashCode()
java.lang.String
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, getSerializedSize, getString, getTimestamp, isAtomic, isJsonNull, isNull, isNumeric, toJson, toString
-
-
-
-
Method Detail
-
getType
public FieldValue.Type getType()
Description copied from class:FieldValue
Returns the type of the object- Specified by:
getType
in classFieldValue
- Returns:
- the type
-
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 classFieldValue
- 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 classFieldValue
- Returns:
- a double value
-
getNumber
public java.math.BigDecimal getNumber()
Returns a BigDecimal value for this object.- Overrides:
getNumber
in classFieldValue
- 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 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-