Class Bin

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

public final class Bin extends Object
Column name/value pair.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    Bin name.
    final Value
    Bin value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Bin(String name, boolean value)
    Constructor, specifying bin name and boolean value.
    Bin(String name, byte value)
    Constructor, specifying bin name and byte value.
    Bin(String name, byte[] value)
    Constructor, specifying bin name and byte array value.
    Bin(String name, byte[] value, int type)
    Constructor, specifying bin name, byte array value and particle type.
    Bin(String name, byte[] value, int offset, int length)
    Constructor, specifying bin name and byte array segment value.
    Bin(String name, double value)
    Constructor, specifying bin name and double value.
    Bin(String name, float value)
    Constructor, specifying bin name and float 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, short value)
    Constructor, specifying bin name and short value.
    Bin(String name, Value value)
    Constructor, specifying bin name and value.
    Bin(String name, String value)
    Constructor, specifying bin name and string value.
    Bin(String name, List<?> value)
    Create bin with a list value.
    Bin(String name, List<? extends Map.Entry<?,?>> value, MapOrder mapOrder)
    Create a map bin from a list of key/value entries.
    Bin(String name, Map<?,?> value)
    Create bin with a map value.
    Bin(String name, Map<?,?> value, MapOrder mapOrder)
    Deprecated.
    Bin(String name, SortedMap<?,?> value)
    Create bin with a sorted map value.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Bin
    asGeoJSON(String name, String value)
    Create bin with a GeoJSON value.
    static Bin
    asNull(String name)
    Create bin with a null value.
    boolean
    Compare Bin for equality.
    int
    Return hash code for Bin.
    Return string representation of bin.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      public final String name
      Bin name. Current limit is 15 characters.
    • value

      public final Value value
      Bin value.
  • Constructor Details

    • Bin

      public Bin(String name, String value)
      Constructor, specifying bin name and string value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, byte[] value)
      Constructor, specifying bin name and byte array value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, byte[] value, int type)
      Constructor, specifying bin name, byte array value and particle type. For internal use only.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
      type - bin type, see ParticleType
    • Bin

      public Bin(String name, byte[] value, int offset, int length)
      Constructor, specifying bin name and byte array segment value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - byte array value
      offset - byte array segment offset
      length - byte array segment length
    • Bin

      public Bin(String name, byte value)
      Constructor, specifying bin name and byte value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, short value)
      Constructor, specifying bin name and short value. The server will convert all shorts to longs.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, int value)
      Constructor, specifying bin name and integer value. The server will convert all integers to longs.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, long value)
      Constructor, specifying bin name and long value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, double value)
      Constructor, specifying bin name and double value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, float value)
      Constructor, specifying bin name and float value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, boolean value)
      Constructor, specifying bin name and boolean value. Either a boolean or integer bin is sent to the server, depending on configuration Value.UseBoolBin.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, List<?> value)
      Create bin with a list value. The list value will be serialized as a server list type.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, Map<?,?> value)
      Create bin with a map value. The map value will be serialized as a server map type.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      public Bin(String name, SortedMap<?,?> value)
      Create bin with a sorted map value. The map value will be serialized as a server ordered map type.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • Bin

      @Deprecated public Bin(String name, Map<?,?> value, MapOrder mapOrder)
      Deprecated.
      This constructor is deprecated. Use Bin(String, Map) if the map is unsorted (like HashMap). Use Bin(String, SortedMap) if the map is sorted (like TreeMap).

      Create bin with a map value and order. The map value will be serialized as a server map type.

      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value, pass in a SortedMap instance if map order is sorted.
      mapOrder - map sorted order.
    • Bin

      public Bin(String name, List<? extends Map.Entry<?,?>> value, MapOrder mapOrder)
      Create a map bin from a list of key/value entries. The value will be serialized as a server map type with specified mapOrder.
      Parameters:
      name - bin name, current limit is 15 characters
      value - list of key/value entries already in desired sorted order
      mapOrder - map sorted order
    • Bin

      public Bin(String name, Value value)
      Constructor, specifying bin name and value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
  • Method Details

    • asNull

      public static Bin asNull(String name)
      Create bin with a null value. This is useful for bin deletions within a record.
      Parameters:
      name - bin name, current limit is 15 characters
    • asGeoJSON

      public static Bin asGeoJSON(String name, String value)
      Create bin with a GeoJSON value.
      Parameters:
      name - bin name, current limit is 15 characters
      value - bin value
    • toString

      public String toString()
      Return string representation of bin.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Compare Bin for equality.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Return hash code for Bin.
      Overrides:
      hashCode in class Object