private Long[] getRoleIds(User user) {
return Stream.of(user.getRoleIds().split(","))
.map(Long::valueOf)
.collect(Collectors.toList()).toArray(new Long[0]);
}
今天看到项目中,这个方法很奇怪,把llist中的long类型数据转成数组long类型,出现了这种写法lists.toArray(new Long[0]);没看明白。记录一下
https://blog.csdn.net/jjdhshdahhdd/article/details/8290555