I am new to LinkedHashMap
and I want to put elements <String, Integer>
in my Map with IntStream instead of filter.put("1", 1)... Is there any way to do it?
private Map<String, Integer> filter = new LinkedHashMap<>();
@PostConstruct
public void init() throws IdNotFoundException {
filter.put("1", 1);
filter.put("2", 2);
filter.put("3", 3);
filter.put("4", 4);
filter.put("5", 5);
filter.put("6", 6);
filter.put("7", 7);
filter.put("8", 8);
filter.put("9", 9);
filter.put("10", 10);
filter.put("All", -1);
}