Set<Long> idsSet = new HashSet<Long>();
//过滤没有详情的id
for(Entry<Long, UserProfile> entry : userProfileMap.entrySet()){
UserProfile userProfile = entry.getValue();
if (userProfile == null) {
continue;
}
idsSet.add(userProfile.getUserId());
}
Long[] idsLong = idsSet.toArray(new Long[0]);
int idsLen = idsLong.length;
long[] idslong = new long[idsLen];
for(int i = 0; i < idsLen; i++){
idslong[i] = idsLong[i];
}
long数组与Long数组转换
最新推荐文章于 2023-04-24 21:35:57 发布