泛型转换

public <H, T> String exportShippingDocument(int sheetNum,List<H> head, List<T> list, String fileName, String tname) {

 for (T el : list) {
                    if (el instanceof ShippingDocumentsListDto) {
                        ShippingDocumentsListDto item = (ShippingDocumentsListDto)el;
                    }
                }
}

 

posted @ 2020-05-19 14:28  丁焕轩  阅读(153)  评论(0编辑  收藏  举报