/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.jackrabbit.oak.spi.state;

import org.apache.jackrabbit.oak.api.CommitFailedException;

public interface NodeStoreBranch {

    /**
     * Returns the latest state of the branch.
     *
     * @return root node state
     */
    NodeState getRoot();

    /**
     * Returns the base state of this branch.
     *
     * @return base node state
     */
    NodeState getBase();

    /**
     * Updates the state of the content tree.
     *
     * @param newRoot new root node state
     */
    void setRoot(NodeState newRoot);

    /**
     * Moves a node.
     *
     * @param source source path
     * @param target target path
     * @return  {@code true} iff the move succeeded
     */
    boolean move(String source, String target);

    /**
     * Copies a node.
     *
     * @param source source path
     * @param target target path
     * @return  {@code true} iff the copy succeeded
     */
    boolean copy(String source, String target);

    /**
     * Merges the changes in this branch to the main content tree.
     * @return the node state resulting from the merge.
     *
     * @throws CommitFailedException if the merge failed
     */
    NodeState merge() throws CommitFailedException;

}


@@ -902,16 +902,50 @@
 ption;%0A%0A
+import javax.annotation.Nonnull;%0A%0A
 public i
@@ -1065,32 +1065,45 @@
 e state%0A     */%0A
+    @Nonnull%0A
     NodeState ge
@@ -1200,32 +1200,32 @@
  node state%0A
-
      */%0A
     NodeStat
@@ -1204,32 +1204,45 @@
 e state%0A     */%0A
+    @Nonnull%0A
     NodeState ge
@@ -2022,24 +2022,37 @@
 led%0A     */%0A
+    @Nonnull%0A
     NodeStat

Use nullability annotation to enforce/document API contract - add nullability annotations to NodeStoreBranch