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

com.enonic.xp.node.MultiRepoNodeHits Maven / Gradle / Ivy

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.google.common.collect.ImmutableList;

import com.enonic.xp.support.AbstractImmutableEntityList;

public class MultiRepoNodeHits
    extends AbstractImmutableEntityList
{
    private MultiRepoNodeHits( final Collection hits )
    {
        super( ImmutableList.copyOf( hits ) );
    }

    public static MultiRepoNodeHits empty()
    {
        final List returnFields = new ArrayList<>();
        return new MultiRepoNodeHits( returnFields );
    }

    private static MultiRepoNodeHits from( final Collection returnFields )
    {
        return new MultiRepoNodeHits( returnFields );
    }

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

    public static class Builder
    {
        private final List nodeHits = new ArrayList<>();

        public Builder add( final MultiRepoNodeHit nodeHit )
        {
            this.nodeHits.add( nodeHit );
            return this;
        }

        public MultiRepoNodeHits build()
        {
            return new MultiRepoNodeHits( this.nodeHits );
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy