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

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

The newest version!
package com.enonic.xp.node;

import com.google.common.collect.ImmutableMap;

import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.branch.Branch;

@PublicApi
public class GetActiveNodeVersionsResult
{
    private final ImmutableMap nodeVersions;

    private GetActiveNodeVersionsResult( Builder builder )
    {
        nodeVersions = builder.nodeVersions.build();
    }

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

    public ImmutableMap getNodeVersions()
    {
        return nodeVersions;
    }


    public static final class Builder
    {
        private final ImmutableMap.Builder nodeVersions = ImmutableMap.builder();

        private Builder()
        {
        }

        public Builder add( final Branch branch, final NodeVersionMetadata nodeVersionMetadata )
        {
            this.nodeVersions.put( branch, nodeVersionMetadata );
            return this;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy