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

com.enonic.xp.query.aggregation.DateHistogramAggregationQuery Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.query.aggregation;

import com.google.common.base.MoreObjects;

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public class DateHistogramAggregationQuery
    extends AbstractHistogramAggregationQuery
{
    private final String format;

    private DateHistogramAggregationQuery( final Builder builder )
    {
        super( builder, builder.interval );
        this.format = builder.format;
    }

    @Override
    public String toString()
    {
        return MoreObjects.toStringHelper( this ).omitNullValues().
            add( "name", getName() ).
            add( "fieldName", getFieldName() ).
            add( "format", format ).
            toString();
    }

    public String getFormat()
    {
        return format;
    }

    public static Builder create( final String name )
    {
        return new Builder( name );
    }

    public static class Builder
        extends AbstractHistogramAggregationQuery.Builder
    {
        private String format;

        public Builder( final String name )
        {
            super( name );
        }

        public Builder format( final String format )
        {
            this.format = format;
            return this;
        }

        public DateHistogramAggregationQuery build()
        {
            return new DateHistogramAggregationQuery( this );
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy