All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cool.scx.data.query.GroupBy Maven / Gradle / Ivy

There is a newer version: 2.7.4
Show newest version
package cool.scx.data.query;

import cool.scx.data.Query;

import java.util.Arrays;

/**
 * 分组
 *
 * @author scx567888
 * @version 0.0.1
 */
public final class GroupBy implements Query {

    /**
     * 分组字段列表
     */
    private Object[] groupByClauses;

    /**
     * 创建一个 OrderBy 对象
     */
    public GroupBy() {
        this.groupByClauses = new Object[]{};
    }

    /**
     * 根据旧的 GroupBy 创建一个 GroupBy 对象
     *
     * @param oldGroupBy 旧的 GroupBy
     */
    public GroupBy(GroupBy oldGroupBy) {
        this.groupByClauses = Arrays.copyOf(oldGroupBy.groupByClauses, oldGroupBy.groupByClauses.length);
    }

    /**
     * set
     *
     * @param groupByClauses a
     * @return a
     */
    public GroupBy set(Object... groupByClauses) {
        this.groupByClauses = groupByClauses;
        return this;
    }

    public Object[] clauses() {
        return this.groupByClauses;
    }

    /**
     * clear
     *
     * @return self
     */
    public GroupBy clear() {
        this.groupByClauses = new Object[]{};
        return this;
    }

    @Override
    public GroupBy getGroupBy() {
        return this;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy