List<List<Object>> results = new ArrayList<>();
String[] allPKs = pkList.split(";");
for(String pk : allPKs) {
String[] encodedColumns = pk.split(",");
if(encodedColumns.length != columnCount) {
throw new KeyColumnMismatchException("Column count mismatch");
}
boolean colNameSpecified = false;
Object[] decodedColumns = new Object[columnCount];
for(int i = 0; i < columnCount; ++i) {
IndexColumn keyColumn = keyColumns.get(i);
String[] pair = encodedColumns[i].split("=");
final int pos;
final String value;
if(pair.length == 1) {
pos = i;
value = pair[0];
if(colNameSpecified) {
throw new KeyColumnMismatchException("Can not mix values with key/values");
}
} else if(pair.length == 2) {
pos = positionInIndex(primaryKey, pair[0]);
value = pair[1];
if(i > 0 && !colNameSpecified) {
throw new KeyColumnMismatchException("Can not mix values with key/values");
}
colNameSpecified = true;
} else {
throw new KeyColumnMismatchException ("Malformed column=value pair");
}
decodedColumns[pos] = decodeValue(keyColumn, value);
}
results.add(Arrays.asList(decodedColumns));
}