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

com.enonic.xp.aggregation.Buckets Maven / Gradle / Ivy

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

import java.util.LinkedHashSet;
import java.util.Set;

import com.google.common.collect.ImmutableSet;

import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.support.AbstractImmutableEntitySet;

@PublicApi
public class Buckets
    extends AbstractImmutableEntitySet
{
    private Buckets( final Builder builder )
    {
        super( ImmutableSet.copyOf( builder.buckets ) );
    }

    public static Builder create()
    {
        return new Builder();
    }

    public static class Builder
    {
        private final Set buckets = new LinkedHashSet<>();

        public Builder add( final Bucket bucket )
        {
            this.buckets.add( bucket );
            return this;
        }

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


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy