com.aerospike.client
Class Bin

java.lang.Object
  extended by com.aerospike.client.Bin

public final class Bin
extends Object

Column name/value pair.


Field Summary
 String name
          Bin name.
 Value value
          Bin value.
 
Constructor Summary
Bin(String name, byte[] value)
          Constructor, specifying bin name and byte array value.
Bin(String name, byte[] value, int offset, int length)
          Constructor, specifying bin name and byte array segment value.
Bin(String name, int value)
          Constructor, specifying bin name and integer value.
Bin(String name, long value)
          Constructor, specifying bin name and long value.
Bin(String name, Object value)
          Constructor, specifying bin name and object value.
Bin(String name, String value)
          Constructor, specifying bin name and string value.
Bin(String name, Value value)
          Constructor, specifying bin name and value.
 
Method Summary
static Bin asBlob(String name, Object value)
          Create bin with a blob value.
static Bin asList(String name, List<?> value)
          Create bin with a list value.
static Bin asMap(String name, Map<?,?> value)
          Create bin with a map value.
static Bin asNull(String name)
          Create bin with a null value.
 String toString()
          Return string representation of bin.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final String name
Bin name. Current limit is 14 characters.


value

public final Value value
Bin value.

Constructor Detail

Bin

public Bin(String name,
           String value)
Constructor, specifying bin name and string value. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

Bin

public Bin(String name,
           byte[] value)
Constructor, specifying bin name and byte array value. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

Bin

public Bin(String name,
           byte[] value,
           int offset,
           int length)
Constructor, specifying bin name and byte array segment value. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - byte array value
offset - byte array segment offset
length - byte array segment length

Bin

public Bin(String name,
           int value)
Constructor, specifying bin name and integer value. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

Bin

public Bin(String name,
           long value)
Constructor, specifying bin name and long value. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

Bin

public Bin(String name,
           Value value)
Constructor, specifying bin name and value. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

Bin

public Bin(String name,
           Object value)
Constructor, specifying bin name and object value. This is the slowest of the Bin constructors because the type must be determined using multiple "instanceof" checks.

For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value
Method Detail

asList

public static Bin asList(String name,
                         List<?> value)
Create bin with a list value. The list value will be serialized as a Aerospike 3 server list type. Supported by Aerospike 3 servers only. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

asMap

public static Bin asMap(String name,
                        Map<?,?> value)
Create bin with a map value. The map value will be serialized as a Aerospike 3 server map type. Supported by Aerospike 3 servers only. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

asBlob

public static Bin asBlob(String name,
                         Object value)
Create bin with a blob value. The value will be java serialized. This method is faster than the bin Object constructor because the blob is converted directly instead of using multiple "instanceof" type checks with a blob default.

For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters
value - bin value

asNull

public static Bin asNull(String name)
Create bin with a null value. This is useful for bin deletions within a record. For servers configured as "single-bin", enter a null or empty name.

Parameters:
name - bin name, current limit is 14 characters

toString

public String toString()
Return string representation of bin.

Overrides:
toString in class Object


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