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

com.enonic.xp.node.ReorderChildNodesResult 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 ReorderChildNodesResult
{
    private final NodeIds nodeIds;

    private final Nodes parentNodes;

    private ReorderChildNodesResult( Builder builder )
    {
        nodeIds = builder.nodeIds.build();
        parentNodes = builder.parentNodes.build();
    }

    public int getSize()
    {
        return nodeIds.getSize();
    }

    public NodeIds getNodeIds()
    {
        return nodeIds;
    }

    public Nodes getParentNodes()
    {
        return parentNodes;
    }

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

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

        final Nodes.Builder parentNodes = Nodes.create();

        private Builder()
        {
        }

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

        public Builder addParentNode( final Node parentNode )
        {
            this.parentNodes.add( parentNode );
            return this;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy