Java8常用代码

list.parallelStream().map(p -> {

p.setAdmin("123"); 
return p; 

}).collect(Collectors.toList());


exBlack.parallelStream().map(p -> "(" + p.getAccountCode() + "," + p.getCifNo() + ")")

    .collect(Collectors.joining(",")); 

jfPoolBusinessList.stream().map(
     p->p.getBusinessNumber()
).collect(Collectors.joing(","))

List<String> stringList = objectList.stream()
                    .map(Object::toString)
                    .collect(Collectors.toList());

jfBlackCustomers.parallelStream().forEach(e -> {
    Optional<JfPointAgg> optionalJfPointAgg = jfPointAggList.parallelStream().filter(p -> p.getCifNo().equals(e.getCifNo())).findAny();
    e.setCifName(optionalJfPointAgg.orElse(null).getCustName());
});

扫描二维码,在手机上阅读!

发表评论

电子邮件地址不会被公开。 必填项已用*标注