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

org.neogroup.warp.data.query.traits.HasGroupByFields Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package org.neogroup.warp.data.query.traits;

import org.neogroup.warp.data.query.fields.Field;

import java.util.Collections;
import java.util.List;

public interface HasGroupByFields {

    List getGroupByFields();

    R setGroupByFields (List groupByFields);

    default R groupBy(String... fields) {
        List groupByFields = getGroupByFields();
        for (String field : fields) {
            groupByFields.add(new Field(field));
        }
        return (R)this;
    }

    default R groupBy(Field... groupByFields) {
        Collections.addAll(getGroupByFields(), groupByFields);
        return (R)this;
    }

    default R clearGroupByFields() {
        getGroupByFields().clear();
        return (R)this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy