Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions client/src/com/aerospike/client/exp/ListExp.java
Original file line number Diff line number Diff line change
Expand Up @@ -482,28 +482,14 @@ private static Exp addRead(Exp bin, byte[] bytes, Exp.Type retType) {
private static Exp.Type getValueType(int returnType) {
int t = returnType & ~ListReturnType.INVERTED;

switch (t) {
case ListReturnType.INDEX:
case ListReturnType.REVERSE_INDEX:
case ListReturnType.RANK:
case ListReturnType.REVERSE_RANK:
// This method only called from expressions that can return multiple integers (ie list).
return Exp.Type.LIST;

case ListReturnType.COUNT:
return Exp.Type.INT;

case ListReturnType.VALUE:
// This method only called from expressions that can return multiple objects (ie list).
return Exp.Type.LIST;

case ListReturnType.EXISTS:
return Exp.Type.BOOL;

default:
case ListReturnType.NONE:
throw new AerospikeException("Invalid ListReturnType: " + returnType);
}
return switch (t) {
case ListReturnType.INDEX, ListReturnType.REVERSE_INDEX,
ListReturnType.RANK, ListReturnType.REVERSE_RANK,
ListReturnType.VALUE -> Exp.Type.LIST;
case ListReturnType.COUNT -> Exp.Type.INT;
case ListReturnType.EXISTS -> Exp.Type.BOOL;
default -> throw new AerospikeException("Invalid ListReturnType: " + returnType);
};
}

protected static byte[] packRangeOperation(int command, int returnType, Exp begin, Exp end, CTX[] ctx) {
Expand Down