I would like to transform a Map<String, List<Object>>
so it becomes Map<String, String>
. If it were just Map<String, Object>
it is easy in Java8;
stream().collect(k -> k.getValue().getMyKey(), Entry::getKey);
But this will not work because getValue returns a List Map<List<Object>, String>
in my example. Assume Object contains a getter to be used for the key and that Object
does not contain the key in the first map.
Any thoughts?