How can i use forEach with lamba for something like:
Map<Integer,Map<String,String>
i want to check if Map (this - string,string) contains key in function parameter
thanks for help ;)
答案 0 :(得分:2)
static boolean containsInnerKey(String key, Map<Integer, Map<String, String>> map) {
return map.values()
.stream()
.anyMatch(m -> m.containsKey(key));
}