danbarrese
9/13/2016 - 9:54 PM

change Map value to another type. Java Stream collect as map.

change Map value to another type. Java Stream collect as map.

Map<String, String> x;
Map<String, Integer> y =
    x.entrySet().stream()
        .collect(Collectors.toMap(
            e -> e.getKey(),
            e -> Integer.parseInt(e.getValue())
        ));