|
@@ -3,7 +3,9 @@ package cn.com.qmth.examcloud.api.commons.security.bean;
|
|
|
import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
+import java.util.Optional;
|
|
|
import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
public class UserDataRule implements JsonSerializable {
|
|
|
|
|
@@ -61,14 +63,14 @@ public class UserDataRule implements JsonSerializable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 返回String类型的值集合(特殊情况下使用)
|
|
|
+ * 返回String值类型的“refIds”集合
|
|
|
*/
|
|
|
public Set<String> stringRefIds() {
|
|
|
- Set<String> stringRefIds = new HashSet<>();
|
|
|
- for (Long id : getRefIds()) {
|
|
|
- stringRefIds.add(String.valueOf(id));
|
|
|
- }
|
|
|
- return stringRefIds;
|
|
|
+ return Optional.ofNullable(refIds)
|
|
|
+ .orElse(new HashSet<>())
|
|
|
+ .stream()
|
|
|
+ .map(e -> String.valueOf(e))
|
|
|
+ .collect(Collectors.toSet());
|
|
|
}
|
|
|
|
|
|
@Override
|