com.aerospike.client
Class Value

java.lang.Object
  extended by com.aerospike.client.Value
Direct Known Subclasses:
Value.BlobValue, Value.ByteSegmentValue, Value.BytesValue, Value.IntegerValue, Value.ListValue, Value.LongValue, Value.MapValue, Value.NullValue, Value.StringValue, Value.ValueArray

public abstract class Value
extends Object

Polymorphic value classes used to efficiently serialize objects into the wire protocol.


Nested Class Summary
static class Value.BlobValue
          Blob value.
static class Value.ByteSegmentValue
          Byte segment value.
static class Value.BytesValue
          Byte array value.
static class Value.IntegerValue
          Integer value.
static class Value.ListValue
          List value.
static class Value.LongValue
          Long value.
static class Value.MapValue
          Map value.
static class Value.NullValue
          Empty value.
static class Value.StringValue
          String value.
static class Value.ValueArray
          Value array.
 
Constructor Summary
Value()
           
 
Method Summary
abstract  int estimateSize()
          Calculate number of bytes necessary to serialize the value in the wire protocol.
static Value get(byte[] value)
          Get byte array or null value instance.
static Value get(byte[] value, int offset, int length)
          Get byte segment or null value instance.
static Value get(int value)
          Get integer value instance.
static Value get(long value)
          Get long value instance.
static Value get(Object value)
          Determine value given generic object.
static Value get(String value)
          Get string or null value instance.
static Value get(Value[] value)
          Get value array instance.
static Value getAsBlob(Object value)
          Get blob or null value instance.
static Value getAsList(List<?> value)
          Get list or null value instance.
static Value getAsMap(Map<?,?> value)
          Get map or null value instance.
static Value getAsNull()
          Get null value instance.
abstract  org.luaj.vm2.LuaValue getLuaValue()
          Return value as an Object.
abstract  Object getObject()
          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.
abstract  int write(byte[] buffer, int offset)
          Serialize the value in the wire protocol.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Value

public Value()
Method Detail

get

public static Value get(String value)
Get string or null value instance.


get

public static Value get(byte[] value)
Get byte array or null value instance.


get

public static Value get(byte[] value,
                        int offset,
                        int length)
Get byte segment or null value instance.


get

public static Value get(int value)
Get integer value instance.


get

public static Value get(long value)
Get long value instance.


get

public static Value get(Value[] value)
Get value array instance.


getAsBlob

public static Value getAsBlob(Object value)
Get blob or null value instance.


getAsList

public static Value getAsList(List<?> value)
Get list or null value instance. Supported by Aerospike 3 servers only.


getAsMap

public static Value getAsMap(Map<?,?> value)
Get map or null value instance. Supported by Aerospike 3 servers only.


getAsNull

public static Value getAsNull()
Get null value instance.


get

public static Value get(Object value)
Determine value given generic object. This is the slowest of the Value get() methods.


estimateSize

public abstract int estimateSize()
                          throws AerospikeException
Calculate number of bytes necessary to serialize the value in the wire protocol.

Throws:
AerospikeException

write

public abstract int write(byte[] buffer,
                          int offset)
                   throws AerospikeException
Serialize the value in the wire protocol.

Throws:
AerospikeException

pack

public abstract void pack(com.aerospike.client.util.Packer packer)
                   throws IOException
Serialize the value using MessagePack.

Throws:
IOException

getType

public abstract int getType()
Get wire protocol value type.


getObject

public abstract Object getObject()
Return original value as an Object.


getLuaValue

public abstract org.luaj.vm2.LuaValue getLuaValue()
Return value as an Object.



Copyright © 2012–2014 Aerospike, Inc. All rights reserved.