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
Nested ClassesModifier and TypeClassDescriptionstatic final classBoolean value.static final classBoolean value that converts to integer when sending a bin to the server.static final classByte segment value.static final classByte array value.static final classByte value.static final classDouble value.static final classFloat value.static final classGeoJSON value.static final classHyperLogLog value.static final classInfinity value.static final classInteger value.static final classList value.static final classLong value.static final classMap value.static final classEmpty value.static final classShort value.static final classSorted map value.static final classString value.static final classValue array.static final classWildcard value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ValueInfinity value to be used in CDT range comparisons only.static final ValueNull value.static booleanShould the client return a map whenMapReturnType.KEY_VALUEis specified in a map read operation and the server returns a list of key/value pairs.static booleanShould client send boolean particle type for a boolean bin.static final ValueWildcard value to be used in CDT range comparisons only. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCalculate the approximate number of bytes necessary to serialize a key in the wire protocol.abstract intCalculate number of bytes necessary to serialize the value in the wire protocol.static Valueget(boolean value) Get boolean value instance.static Valueget(byte value) Get byte value instance.static Valueget(byte[] value) Get byte array or null value instance.static Valueget(byte[] value, int type) Get byte array with type or null value instance.static Valueget(byte[] value, int offset, int length) Get byte segment or null value instance.static Valueget(double value) Get double value instance.static Valueget(float value) Get float value instance.static Valueget(int value) Get integer value instance.static Valueget(long value) Get long value instance.static Valueget(short value) Get short value instance.static ValueGet value array instance.static ValueGet enum value string instance.static ValueDetermine value given generic object.static ValueGet string or null value instance.static Valueget(ByteBuffer bb) Get byte segment or null value instance.static ValueGet list or null value instance.static ValueGet sorted map or null value instance.static ValueGet map or null value instance.static ValueDeprecated.static ValueGet sorted map or null value instance.static ValueGet UUID value string instance.static ValuegetAsGeoJSON(String value) Get GeoJSON or null value instance.static ValuegetAsHLL(byte[] value) Get HyperLogLog or null value instance.static ValueGet null value instance.static ValuegetFromRecordObject(Object value) Deprecated.abstract org.luaj.vm2.LuaValuegetLuaValue(com.aerospike.client.lua.LuaInstance instance) Return value as an Object.abstract ObjectReturn original value as an Object.abstract intgetType()Get wire protocol value type.abstract voidpack(com.aerospike.client.util.Packer packer) Serialize the value using MessagePack.intReturn value as an integer.longtoLong()Return value as a long.voidValidate if value type can be used as a key.abstract intwrite(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_VALUEis 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.