我正在尝试为Cassandra DB使用Datastax
Java驱动程序
API,并且我有一个具有getList函数的行对象:
public List getList(String name,
Class elementsClass)
Returns the value of column name as a list.
Parameters:
name - the name of the column to retrieve.
elementsClass - the class for the elements of the list to retrieve.
Returns:
the value of the ith column in this row as a list of elementsClass objects. If the value is NULL, an empty list is returned (note that Cassandra makes no difference between an empty list and column of type list that is not set).
我的问题是我如何实际使用它?我不知道如何制作Class< T>的参数. elementsClass类型.在我的例子中,结果应该是一个浮点列表(基于我正在使用的Cassandra模式).