package de.juplo.demo;
-import java.util.LinkedHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.extern.slf4j.Slf4j;
Form form = new Form();
if (param == null)
{
- form.map =
- new LinkedHashMap<>(
- Stream
- .of( "foo", "bar" )
- .collect(Collectors.toMap(a -> a, a -> false)));
+ Stream
+ .of( "foo", "bar" )
+ .forEach(option -> form.map.put(option, false));
}
return form;
}
package de.juplo.demo;
+import java.util.LinkedHashMap;
import java.util.Map;
import lombok.Data;
{
Boolean option;
Inner inner = new Inner();
- Map<String, Boolean> map;
+ Map<String, Boolean> map = new LinkedHashMap<>();
}
@Data