是否有更优雅的解决方案将“ Arraylist
”转换为“ Arraylist<Type>
”?
当前代码:
ArrayList productsArrayList=getProductsList();
ArrayList<ProductListBean> productList = new ArrayList<ProductListBean>();
for (Object item : productsArrayList)
{
ProductListBean product = (ProductListBean)item;
productList.add(product);
}