遍历List
遍历houses使用forEach
lamda表达式
List<House> houses = houseMapper.selectPageHouses(query, pageParams);
houses.forEach(h->{
h.setFirstImg(imgPrefix + h.getFirstImg());
h.setImageList(h.getImageList().stream().map(img->imgPrefix + img ).collect(Collectors.toList()));
};
判断字符串为null或者为空
Strings.isNullOrEmpty()
创建ArrayList
Lists.newArrayList();
List的长度为0
list.isEmpty()
对字符串进行分割
Splitter.on(",").splitToList(imagesStr);