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

net.ravendb.client.documents.session.tokens.GroupByToken Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package net.ravendb.client.documents.session.tokens;

import net.ravendb.client.documents.queries.GroupByMethod;

public class GroupByToken extends QueryToken {

    private final String _fieldName;
    private final GroupByMethod _method;

    private GroupByToken(String fieldName, GroupByMethod method) {
        _fieldName = fieldName;
        _method = method;
    }

    public static GroupByToken create(String fieldName) {
        return create(fieldName, GroupByMethod.NONE);
    }

    public static GroupByToken create(String fieldName, GroupByMethod method) {
        return new GroupByToken(fieldName, method);
    }

    @Override
    public void writeTo(StringBuilder writer) {
        if (_method != GroupByMethod.NONE) {
            writer.append("Array(");
        }
        writeField(writer, _fieldName);
        if (_method != GroupByMethod.NONE) {
            writer.append(")");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy