Package com.aerospike.client
Class Value
java.lang.Object
com.aerospike.client.Value
- Direct Known Subclasses:
Value.BooleanValue
,Value.BoolIntValue
,Value.ByteSegmentValue
,Value.BytesValue
,Value.ByteValue
,Value.DoubleValue
,Value.FloatValue
,Value.GeoJSONValue
,Value.HLLValue
,Value.InfinityValue
,Value.IntegerValue
,Value.ListValue
,Value.LongValue
,Value.MapValue
,Value.NullValue
,Value.ShortValue
,Value.SortedMapValue
,Value.StringValue
,Value.ValueArray
,Value.WildcardValue
Polymorphic value classes used to efficiently serialize objects into the wire protocol.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Boolean value.static final class
Boolean value that converts to integer when sending a bin to the server.static final class
Byte segment value.static final class
Byte array value.static final class
Byte value.static final class
Double value.static final class
Float value.static final class
GeoJSON value.static final class
HyperLogLog value.static final class
Infinity value.static final class
Integer value.static final class
List value.static final class
Long value.static final class
Map value.static final class
Empty value.static final class
Short value.static final class
Sorted map value.static final class
String value.static final class
Value array.static final class
Wildcard value. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Value
Infinity value to be used in CDT range comparisons only.static final Value
Null value.static boolean
Should the client return a map whenMapReturnType.KEY_VALUE
is specified in a map read operation and the server returns a list of key/value pairs.static boolean
Should client send boolean particle type for a boolean bin.static final Value
Wildcard value to be used in CDT range comparisons only. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Calculate the approximate number of bytes necessary to serialize a key in the wire protocol.abstract int
Calculate number of bytes necessary to serialize the value in the wire protocol.static Value
get
(boolean value) Get boolean value instance.static Value
get
(byte value) Get byte value instance.static Value
get
(byte[] value) Get byte array or null value instance.static Value
get
(byte[] value, int type) Get byte array with type or null value instance.static Value
get
(byte[] value, int offset, int length) Get byte segment or null value instance.static Value
get
(double value) Get double value instance.static Value
get
(float value) Get float value instance.static Value
get
(int value) Get integer value instance.static Value
get
(long value) Get long value instance.static Value
get
(short value) Get short value instance.static Value
Get value array instance.static Value
Get enum value string instance.static Value
Determine value given generic object.static Value
Get string or null value instance.static Value
get
(ByteBuffer bb) Get byte segment or null value instance.static Value
Get list or null value instance.static Value
Get sorted map or null value instance.static Value
Get map or null value instance.static Value
Deprecated.static Value
Get sorted map or null value instance.static Value
Get UUID value string instance.static Value
getAsGeoJSON
(String value) Get GeoJSON or null value instance.static Value
getAsHLL
(byte[] value) Get HyperLogLog or null value instance.static Value
Get null value instance.static Value
getFromRecordObject
(Object value) Deprecated.abstract org.luaj.vm2.LuaValue
getLuaValue
(com.aerospike.client.lua.LuaInstance instance) Return value as an Object.abstract Object
Return original value as an Object.abstract int
getType()
Get wire protocol value type.abstract void
pack
(com.aerospike.client.util.Packer packer) Serialize the value using MessagePack.int
Return value as an integer.long
toLong()
Return value as a long.void
Validate if value type can be used as a key.abstract int
write
(byte[] buffer, int offset) Serialize the value in the wire protocol.
-
Field Details
-
UseBoolBin
public static boolean UseBoolBinShould client send boolean particle type for a boolean bin. If false, an integer particle type (1 or 0) is sent instead. Must be false for server versions less than 5.6 which do not support boolean bins. Can set to true for server 5.6+. -
ReturnMapForKeyValue
public static boolean ReturnMapForKeyValueShould the client return a map whenMapReturnType.KEY_VALUE
is specified in a map read operation and the server returns a list of key/value pairs. -
NULL
Null value. -
INFINITY
Infinity value to be used in CDT range comparisons only. -
WILDCARD
Wildcard value to be used in CDT range comparisons only.
-
-
Constructor Details
-
Value
public Value()
-
-
Method Details
-
get
Get string or null value instance. -
get
Get byte array or null value instance. -
get
Get byte array with type or null value instance. -
get
Get byte segment or null value instance. -
get
Get byte segment or null value instance. -
get
Get byte value instance. -
get
Get short value instance. -
get
Get integer value instance. -
get
Get long value instance. -
get
Get double value instance. -
get
Get float value instance. -
get
Get boolean value instance. -
get
Get enum value string instance. -
get
Get UUID value string instance. -
get
Get list or null value instance. -
get
Get map or null value instance. -
get
Get sorted map or null value instance. -
get
Deprecated.This method is deprecated. Useget(Map)
if the map is unsorted (like HashMap). Useget(SortedMap)
if the map is sorted (like TreeMap).Get map or null value instance.
-
get
Get sorted map or null value instance. -
get
Get value array instance. -
getAsGeoJSON
Get GeoJSON or null value instance. -
getAsHLL
Get HyperLogLog or null value instance. -
getAsNull
Get null value instance. -
get
Determine value given generic object. This is the slowest of the Value get() methods. Useful when copying records from one cluster to another. -
getFromRecordObject
Deprecated.Use
get(Object)
instead.Get value from Record object. Useful when copying records from one cluster to another. -
estimateKeySize
public int estimateKeySize()Calculate the approximate number of bytes necessary to serialize a key in the wire protocol. Size is not exact and may be greater than the actual bytes needed. Size must not be underestimated. -
estimateSize
Calculate number of bytes necessary to serialize the value in the wire protocol.- Throws:
AerospikeException
-
write
Serialize the value in the wire protocol.- Throws:
AerospikeException
-
pack
public abstract void pack(com.aerospike.client.util.Packer packer) Serialize the value using MessagePack. -
validateKeyType
Validate if value type can be used as a key.- Throws:
AerospikeException
- if type can't be used as a key.
-
getType
public abstract int getType()Get wire protocol value type. -
getObject
Return original value as an Object. -
getLuaValue
public abstract org.luaj.vm2.LuaValue getLuaValue(com.aerospike.client.lua.LuaInstance instance) Return value as an Object. -
toInteger
public int toInteger()Return value as an integer. -
toLong
public long toLong()Return value as a long.
-
get(Object)
instead.