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

com.atlan.model.fields.NumericField Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
/* SPDX-License-Identifier: Apache-2.0
   Copyright 2023 Atlan Pte. Ltd. */
package com.atlan.model.fields;

import co.elastic.clients.elasticsearch._types.aggregations.Aggregation;
import co.elastic.clients.elasticsearch._types.query_dsl.Query;
import com.atlan.model.lineage.LineageFilterFieldNumeric;

/**
 * Represents any field in Atlan that can be searched using only numeric search operations.
 */
public class NumericField extends SearchableField implements INumericallySearchable {

    public final LineageFilterFieldNumeric inLineage = new LineageFilterFieldNumeric(this);

    /**
     * Default constructor.
     *
     * @param atlan name of the attribute in the metastore
     * @param numeric name of the numeric field in the search index
     */
    public NumericField(String atlan, String numeric) {
        super(atlan, numeric);
    }

    /** {@inheritDoc} */
    @Override
    public String getNumericFieldName() {
        return getElasticFieldName();
    }

    /** {@inheritDoc} */
    @Override
    public  Query eq(T value) {
        return INumericallySearchable.eq(getNumericFieldName(), value);
    }

    /** {@inheritDoc} */
    @Override
    public  Query gt(T value) {
        return INumericallySearchable.gt(getNumericFieldName(), value);
    }

    /** {@inheritDoc} */
    @Override
    public  Query gte(T value) {
        return INumericallySearchable.gte(getNumericFieldName(), value);
    }

    /** {@inheritDoc} */
    @Override
    public  Query lt(T value) {
        return INumericallySearchable.lt(getNumericFieldName(), value);
    }

    /** {@inheritDoc} */
    @Override
    public  Query lte(T value) {
        return INumericallySearchable.lte(getNumericFieldName(), value);
    }

    /** {@inheritDoc} */
    @Override
    public  Query between(T min, T max) {
        return INumericallySearchable.between(getNumericFieldName(), min, max);
    }

    /** {@inheritDoc} */
    @Override
    public Aggregation sum() {
        return INumericallySearchable.sum(getNumericFieldName());
    }

    /** {@inheritDoc} */
    @Override
    public Aggregation avg() {
        return INumericallySearchable.avg(getNumericFieldName());
    }

    /** {@inheritDoc} */
    @Override
    public Aggregation min() {
        return INumericallySearchable.min(getNumericFieldName());
    }

    /** {@inheritDoc} */
    @Override
    public Aggregation max() {
        return INumericallySearchable.max(getNumericFieldName());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy