Optional 链式操作优雅
map遍历每一项,用一次map就需要用get取出来一次
dao.findAllByTypeId().stream().map( item -> {
// do something
}).collect(Collectors.toList());
IfPresent、IsPresent分支语句
Optional 链式操作优雅
map遍历每一项,用一次map就需要用get取出来一次
dao.findAllByTypeId().stream().map( item -> {
// do something
}).collect(Collectors.toList());
IfPresent、IsPresent分支语句