@Getter @Setter class Directory { Long id; String name; } List<Directory> l = repo.allDirectories(); Map<Long, String> m = l.stream() .collect(Collectors.toMap(d -> d.getId(), d -> d.getName())); |
@Getter @Setter class Directory { Long id; String name; } List<Directory> l = repo.allDirectories(); Map<Long, String> m = l.stream() .collect(Collectors.toMap(d -> d.getId(), d -> d.getName())); |