com.enonic.xp.node.GetActiveNodeVersionsResult Maven / Gradle / Ivy
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 );
}
}
}