convert list of dto to map java

64

convert list of dto to map java -

//Stream apis for versions java8 and above
Map<String, Item> map = 
    list.stream().collect(Collectors.toMap(Item::getKey, item -> item));

Comments

Submit
0 Comments