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

io.vertx.up.uca.jooq.AggregatorMin Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.up.uca.jooq;

import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import org.jooq.impl.DSL;

import java.math.BigDecimal;
import java.util.concurrent.ConcurrentMap;

/**
 * @author Lang
 */
@SuppressWarnings("all")
class AggregatorMin extends AbstractAggregator {
    private static final String FIELD_MIN = "MIN";

    AggregatorMin(final JqAnalyzer analyzer) {
        super(analyzer);
    }

    BigDecimal min(final String field, final JsonObject criteria) {
        return this.aggregateBy(field, criteria,
            column -> DSL.min(column).as(FIELD_MIN), BigDecimal.ZERO);
    }

    ConcurrentMap min(final String field, final JsonObject criteria, final String groupField) {
        return this.aggregateBy(field, criteria,
            column -> DSL.min(column).as(FIELD_MIN), groupField);
    }

    JsonArray min(final String field, final JsonObject criteria, final String... groupFields) {
        return this.aggregateBy(field, criteria,
            column -> DSL.min(column).as(FIELD_MIN), groupFields);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy