Guest User

Untitled

a guest
Jan 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. public void method(Map<?, Model> map){
  2.  
  3. Map<UUID, Model> transformation = map.entrySet()
  4. .stream()
  5. .collect(Collectors.toMap(
  6. entry -> entry.getKey().getId(),
  7. entry-> entry.getValue()
  8. ));
  9. }
  10.  
  11.  
  12. class S{
  13. protected UUID getId(){
  14. // return UUID
  15. }
  16. }
  17.  
  18. class A extends S{
  19. }
  20. class B extends S{
  21. }
  22. class Model{
  23. // bla bla
  24. }
Add Comment
Please, Sign In to add comment