Class CTX

java.lang.Object
com.aerospike.client.cdt.CTX

public final class CTX extends Object
Nested CDT context. Identifies the location of nested list/map to apply the operation. for the current level. An array of CTX identifies location of the list/map on multiple levels on nesting.
  • Field Details

    • id

      public final int id
    • value

      public final Value value
  • Method Details

    • listIndex

      public static CTX listIndex(int index)
      Lookup list by index offset.

      If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:

      • 0: First item.
      • 4: Fifth item.
      • -1: Last item.
      • -3: Third to last item.
    • listIndexCreate

      public static CTX listIndexCreate(int index, ListOrder order, boolean pad)
      Lookup list by base list's index offset. If the list at index offset is not found, create it with the given sort order at that index offset. If pad is true and the index offset is greater than the bounds of the base list, nil entries will be inserted before the newly created list.
    • listRank

      public static CTX listRank(int rank)
      Lookup list by rank.
      • 0 = smallest value
      • N = Nth smallest value
      • -1 = largest value
    • listValue

      public static CTX listValue(Value key)
      Lookup list by value.
    • mapIndex

      public static CTX mapIndex(int index)
      Lookup map by index offset.

      If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:

      • 0: First item.
      • 4: Fifth item.
      • -1: Last item.
      • -3: Third to last item.
    • mapRank

      public static CTX mapRank(int rank)
      Lookup map by rank.
      • 0 = smallest value
      • N = Nth smallest value
      • -1 = largest value
    • mapKey

      public static CTX mapKey(Value key)
      Lookup map by key.
    • mapKeyCreate

      public static CTX mapKeyCreate(Value key, MapOrder order)
      Lookup map by base map's key. If the map at key is not found, create it with the given sort order at that key.
    • mapValue

      public static CTX mapValue(Value key)
      Lookup map by value.
    • toBytes

      public static byte[] toBytes(CTX[] ctx)
      Serialize context array to bytes.
    • fromBytes

      public static CTX[] fromBytes(byte[] bytes)
      Deserialize bytes to context array.
    • toBase64

      public static String toBase64(CTX[] ctx)
      Serialize context array to base64 encoded string.
    • fromBase64

      public static CTX[] fromBase64(String base64)
      Deserialize base64 encoded string to context array.