com.enonic.xp.query.suggester.SuggestionQueries Maven / Gradle / Ivy
The newest version!
package com.enonic.xp.query.suggester;
import java.util.Collection;
import com.google.common.collect.ImmutableSet;
import com.enonic.xp.support.AbstractImmutableEntitySet;
public class SuggestionQueries
extends AbstractImmutableEntitySet
{
private SuggestionQueries( final ImmutableSet set )
{
super( set );
}
public static Builder create()
{
return new Builder();
}
public static SuggestionQueries empty()
{
return new SuggestionQueries( ImmutableSet.of() );
}
public static SuggestionQueries fromCollection( final Collection suggestionQueries )
{
return new SuggestionQueries( ImmutableSet.copyOf( suggestionQueries ) );
}
public static final class Builder
{
private final ImmutableSet.Builder suggestionQueries = ImmutableSet.builder();
public Builder add( final SuggestionQuery suggestionQuery )
{
this.suggestionQueries.add( suggestionQuery );
return this;
}
public SuggestionQueries build()
{
return new SuggestionQueries( this.suggestionQueries.build() );
}
}
}