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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user