You can do this:
int sum = data.values().stream().mapToInt(Integer::parseInt).sum();
More Related Contents:
- How to convert to Java 8 map grouping by Map [closed]
- Collection to stream to a new collection
- How to convert a Java 8 Stream to an Array?
- Java type inference: reference is ambiguous in Java 8, but not Java 7
- In Java, what are the advantages of streams over loops? [closed]
- How to sum a list of integers with java streams?
- Java 8 stream’s .min() and .max(): why does this compile?
- Why does Stream not implement Iterable?
- How can I create a stream from an array?
- In Java 8, is there a ByteStream class?
- LambdaConversionException with generics: JVM bug?
- Why does this generic code compile in java 8?
- Sum values from specific field of the objects in a list
- Files.walk(), calculate total size
- Does Stream.forEach respect the encounter order of sequential streams?
- Most efficient way to get the last element of a stream
- Why does findFirst() throw a NullPointerException if the first element it finds is null?
- Sort map by value using lambdas and streams
- Java 8 Stream IllegalStateException: Stream has already been operated on or closed
- Modifying Objects within stream in Java8 while iterating
- Take every nth element from a Java 8 stream
- Static context cannot access non-static in Collectors
- What Java 8 Stream.collect equivalents are available in the standard Kotlin library?
- How to check if exists any duplicate in Java 8 Streams?
- Java 8, how can I implement a switch statement using streams?
- BigDecimal summary statistics
- ‘Optional.get()’ without ‘isPresent()’ check
- Most elegant way to join a Map to a String in Java 8
- How to apply Filtering on groupBy in java streams
- Java 8 stream map to list of keys sorted by values