话不多说,上代码
Student类
package com.zzz.test2.test;
import java.math.BigDecimal;import java.sql.Timestamp;
public class Student {
private String name; private Integer age; private String score; private Integer gender; private BigDecimal height; private Timestamp startTime; private Timestamp endTime;
public String getName() {
return name; }
public void setName(String name) {
this.name = name; }
public Integer getAge() {
return age; }
public void setAge(Integer age) {
this.age = age; }
public String getScore() {
return score; }
public void setScore(String score) {
this.score = score; }
public Integer getGender() {
return gender; }
public void setGender(Integer gender) {
this.gender = gender; }
public BigDecimal getHeight() {
return height; }
public void setHeight(BigDecimal height) {
this.height = height; }
public Timestamp getStartTime() {
return startTime; }
public void setStartTime(Timestamp startTime) {
this.startTime = startTime; }
public Timestamp getEndTime() {
return endTime; }
public void setEndTime(Timestamp endTime) {
this.endTime = endTime; }
public Student(String name, Integer age) {
this.name = name; this.age = age; }
public Student(String name, Integer age, String score) {
this.name = name; this.age = age; this.score = score; }
public Student(String name, Integer age, String score, Integer gender) {
this.name = name; this.age = age; this.score = score; this.gender = gender; }
public Student(String name, Integer age, String score, Integer gender, BigDecimal height) {
this.name = name; this.age = age; this.score = score; this.gender = gender; this.height = height; }
public Student(String name, Integer age, String score, Integer gender, BigDecimal height, Timestamp startTime, Timestamp endTime) {
this.name = name; this.age = age; this.score = score; this.gender = gender; this.height = height; this.startTime = startTime; this.endTime = endTime; }
@Override public String toString() {
return "Student{" +
"name='" + name + '\'' +
", age=" + age +
", score='" + score + '\'' +
", gender=" + gender +
", height=" + height +
", startTime=" + startTime +
", endTime=" + endTime +
'}'; }
}
GroupingBy类
package com.zzz.test2.test;
import org.apache.commons.lang3.StringUtils;
import javax.swing.tree.TreeModel;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.*;
import java.util.function.BinaryOperator