Untitled
wyc1230
plain_text
9 months ago
757 B
8
Indexable
import java.util.*;
import java.util.stream.Collectors;
public class AuthorityProcessor {
public static Map<String, List<String>> convertToMap(List<AuthorityDTO> authorityList) {
return authorityList.stream()
.collect(Collectors.toMap(
AuthorityDTO::getUserLoginId,
authority -> authority.getZoneTypeList().stream()
.filter(zone -> Boolean.TRUE.equals(zone.getUsable()))
.map(ZoneTypeAuthorityDTO::getZoneTypeName)
.collect(Collectors.toList()),
(existing, replacement) -> {
existing.addAll(replacement);
return existing;
}
));
}
}
Editor is loading...
Leave a Comment