private Object convertKey(K key) { if (keyType.getName() == Name.BIGINT) { return key; } else if (keyType.getName() == Name.TEXT) { return key.toString(); } else { throw new RuntimeException("Unhandled DataType: " + keyType); } }
private List<?> convertKeys(Set<K> keys) { if (keyType.getName() == Name.BIGINT) { return new ArrayList<>(keys); } else if (keyType.getName() != Name.TEXT) { throw new RuntimeException("Unhandled DataType: " + keyType); } List<Object> convertedKeys = new ArrayList<>(keys.size()); for (K key : keys) { convertedKeys.add(key.toString()); } return convertedKeys; }