package com.midm.model; /** * 【Java 类型】{@code GroupByResult} * * 类职责: * * * 核心字段(按声明顺序): * * * 协作对象:{@code String[]}。 * * 学习提示:先看类注释和 public 方法,再结合调用方理解它在整体流程中的位置。 */ public class GroupByResult { /** * 分组列表。 */ private String[] groups; /** * 统计。 */ private int count; /** * 获取 {@code count}。 * @return 数量/长度 */ public int getCount() { return this.count; } /** * 设置 {@code count}。 * * @param count 参数 {@code count}({@code int}) */ public void setCount(int count) { this.count = count; } /** * 获取 {@code group}。 * @return 字符串结果 */ public String getGroup() { return this.groups.length > 0 ? this.groups[0] : null; } /** * 获取 {@code groups}。 * @return 字段/派生属性 {@code groups} 的值 */ public String[] getGroups() { return this.groups; } /** * 设置 {@code groups}。 * * @param groups 参数 {@code groups}({@code String[]}) */ public void setGroups(String[] groups) { this.groups = groups; } }