in cassandra-four-zero-types/src/main/java/org/apache/cassandra/spark/data/complex/CqlCollection.java [83:107]
public static CqlCollection build(CqlField.CqlType.InternalType internalType, CqlField.CqlType... types)
{
if (types.length < 1 || types[0] == null)
{
throw new IllegalArgumentException("Collection type requires a non-null key data type");
}
switch (internalType)
{
case Set:
return set(types[0]);
case List:
return list(types[0]);
case Map:
if (types.length < 2 || types[1] == null)
{
throw new IllegalArgumentException("Map collection type requires a non-null value data type");
}
return map(types[0], types[1]);
case Tuple:
return tuple(types);
default:
throw new IllegalArgumentException("Unknown collection type: " + internalType);
}
}