// 從列表對象中獲取字段列表
List<TagVO> tagVOList = new ArrayList<>();
List<String> UserIds = new ArrayList<>();
UserIds = tagVOList.stream().map(TagVO::getCreateUserId).distinct().collect(Collectors.toList());// distinct去掉重復(fù)值
// 過濾掉null值
UserIds = tagVOList.stream().map(TagVO::getCreateUserId).filter(createUserId -> createUserId!=null).distinct().collect(Collectors.toList());
List<String>轉(zhuǎn)List<Long>
List<String> UserStrIds = new ArrayList<>();
List<Long> UserLongIds = new ArrayList<>();
UserLongIds = UserStrIds.stream().map(Long::valueOf).collect(Collectors.toList())
List<String>去null
List<String> UserStrIds = new ArrayList<>();
UserStrIds.removeAll(Collections.singleton(null));
List<String>去重
List<String> UserStrIds = new ArrayList<>();
// 放到Set中
Set<String> set = new HashSet<>(UserStrIds);
// 將去重后的列表賦值
List<String> UserIds = new ArrayList<>(set);