// Collections have this small hack that validate cannot be called on a serialized object,
// but compose does the validation (so we're fine).
List<?> l = (List<?>)type.compose(value);
assert type.elements instanceof TupleType;
TupleType tupleType = (TupleType) type.elements;
// type.split(bytes)
List<List<ByteBuffer>> elements = new ArrayList<>(l.size());
for (Object element : l)
elements.add(Arrays.asList(tupleType.split(type.elements.decompose(element))));
return new InValue(elements);
}
catch (MarshalException e)
{
throw new InvalidRequestException(e.getMessage());