java8新特性stearm()学习

2019-03-25  本文已影响0人  我就要取名叫夏末

工作中看到同事写的代码,不是很理解,特意学习后记录于此

public FunctionResult<Map<String,Date>>getWeekStartTimeMap(String academicYear){
        Map<String,Date> schoolYearWeekStartTimeMap  = new HashMap<>();
        List<ViewDzpSchoolYearDO> yearDOS = viewDzpSchoolYearDOMapper.list(academicYear);
        if(yearDOS.isEmpty()){
            return new FunctionResult(ErrorCode.SchoolYearNotExist);
        }
        Map<Integer,ViewDzpSchoolYearDO> termTypeMap = yearDOS.stream().collect(Collectors.toMap(ViewDzpSchoolYearDO::getTermTypeId, a -> a));

待补充
新特性
https://blog.csdn.net/lidai352710967/article/details/81461119
https://blog.csdn.net/lidai352710967/article/details/82496783

上一篇 下一篇

猜你喜欢

热点阅读