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

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

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

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public class NodeVersionDiffResult
{
    private final NodeIds nodesWithDifferences;

    private final long totalHits;

    private NodeVersionDiffResult( final Builder builder )
    {
        nodesWithDifferences = builder.nodeIds.build();
        totalHits = builder.totalHits;
    }

    public NodeIds getNodesWithDifferences()
    {
        return nodesWithDifferences;
    }

    public long getTotalHits()
    {
        return totalHits;
    }

    public static NodeVersionDiffResult empty()
    {
        return new NodeVersionDiffResult( create() );
    }

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

    public static class Builder
    {
        private final NodeIds.Builder nodeIds = NodeIds.create();

        private long totalHits;

        private Builder()
        {
        }

        public Builder add( final NodeId nodeId )
        {
            this.nodeIds.add( nodeId );
            return this;
        }

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

        public Builder totalHits( final long val )
        {
            totalHits = val;
            return this;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy