Bael 5066 aggregate over multiple fields (#11156)

* Commit source code to branch

* BAEL-5065 improvement of groupBy with complex key

* Aggregation of multiple attributes of a grouped result
This commit is contained in:
mbarriola
2021-08-22 16:57:09 -04:00
committed by GitHub
parent 4039208fac
commit f0e835b817
2 changed files with 61 additions and 8 deletions

View File

@@ -1,5 +1,8 @@
package com.baeldung.java_16_features.groupingby;
import java.util.IntSummaryStatistics;
public class BlogPost {
private String title;
@@ -7,7 +10,9 @@ public class BlogPost {
private BlogPostType type;
private int likes;
record AuthPostTypesLikes(String author, BlogPostType type, int likes) {};
record PostcountTitlesLikesStats(long postCount, String titles, IntSummaryStatistics likesStats){};
record TitlesBoundedSumOfLikes(String titles, int boundedSumOfLikes) {};
public BlogPost(String title, String author, BlogPostType type, int likes) {
this.title = title;
this.author = author;