Java 8 grouping by collector pull request (#1102)

* Char array to string and string to char array test cases added

* Minor code renames

* Added groupingBy collector unit tests

* Added test case for int summary calculation on grouped results

* Added the grouping by classes to the main source path

* Reverting char array to string test class

* Reverting char array to string test class

* Reverting char array to string test class

* Reverting char array to string test class
This commit is contained in:
Tryfon
2017-02-07 12:36:06 +02:00
committed by Sunil Mogadati
parent 178f49e485
commit c13453d772
3 changed files with 173 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package com.baeldung.java_8_features.groupingby;
public class BlogPost {
private String title;
private String author;
private BlogPostType type;
private int likes;
public BlogPost(String title, String author, BlogPostType type, int likes) {
this.title = title;
this.author = author;
this.type = type;
this.likes = likes;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public BlogPostType getType() {
return type;
}
public int getLikes() {
return likes;
}
@Override
public String toString() {
return "BlogPost{" + "title='" + title + '\'' + ", type=" + type + ", likes=" + likes + '}';
}
}

View File

@@ -0,0 +1,5 @@
package com.baeldung.java_8_features.groupingby;
public enum BlogPostType {
NEWS, REVIEW, GUIDE
}