Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final Map<String, String> output =
- input.entrySet()
- .stream()
- .collect(Collectors.toMap(
- o -> o.getKey(),
- o -> o.getValue().getName()
- ));
- Map<Integer, User> users = new HashMap<>();
- users.put(1, new User());
- Map<Integer, String> userIdToUserName = users.entrySet().stream()
- .collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue().getName()));
Add Comment
Please, Sign In to add comment