Java 8 - return list (key set) opposite to <Map.Entry <Integer, CheckBox >>
I am trying to use java 8 to return me a list of key values (Integers) in which the value is marked (Checkbox). The card I'm trying to process has the following form.
Map<Integer, CheckBox> The goal is to return a set of keys for all values where the checkbox is checked.
If I do the following
checkBoxes.entrySet().stream().filter(c -> c.getValue().getValue()) .collect(Collectors.toList()); then I will return to List<Map.Entry<Integer, CheckBox>> . Anyway, to do this all on one line without processing Map.Entry values so that I can just get a list of integers?
thanks
+6