mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-13 22:16:32 +00:00
perf[stream]: stream.toList() replaces collect(Collectors.toList())
This commit is contained in:
1 parent
4783a72703
commit
ac2d01e6fb
19 files changed
+34
-50
No files matched your search
@@ -27,7 +27,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author godotg
|
||||
@@ -120,7 +119,7 @@ public class ResourceInterpreter {
|
||||
}
|
||||
}
|
||||
}
|
||||
return fieldList.stream().map(it -> new FieldInfo(cellFieldMap.get(getExcelFieldName(it)), it)).collect(Collectors.toList());
|
||||
return fieldList.stream().map(it -> new FieldInfo(cellFieldMap.get(getExcelFieldName(it)), it)).toList();;
|
||||
}
|
||||
|
||||
private static class FieldInfo {
|
||||
|
||||
@@ -83,14 +83,14 @@ public abstract class ExportUtils {
|
||||
return FileUtils.getAllReadableFiles(new File(inputDir))
|
||||
.stream()
|
||||
.filter(it -> StorageEnum.isExcel(FileUtils.fileExtName(it.getName())))
|
||||
.collect(Collectors.toList());
|
||||
.toList();;
|
||||
}
|
||||
|
||||
public static List<File> scanCsvFiles(String inputDir) {
|
||||
return FileUtils.getAllReadableFiles(new File(inputDir))
|
||||
.stream()
|
||||
.filter(it -> StorageEnum.getResourceEnumByType(FileUtils.fileExtName(it.getName())) == StorageEnum.CSV)
|
||||
.collect(Collectors.toList());
|
||||
.toList();;
|
||||
}
|
||||
|
||||
// 将class里的map自动赋值storage
|
||||
|
||||
Reference in new issue
Block a user