<commit_before>/*
 * 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.api;

import java.util.List;

/**
 * An editor for modifying existing and creating new
 * {@link NodeState node states}.
 */
public interface NodeStateEditor {

    /**
     * Add the child node state with the given {@code name}. Does nothing
     * if such a child node already exists.
     * @param name name of the new node state
     */
    void addNode(String name);

    /**
     * Remove the child node state with the given {@code name}. Does nothing
     * if no such child node exists.
     * @param name  name of the node state to remove
     */
    void removeNode(String name);

    /**
     * Set a single valued property state on this node state.
     *
     * @param name The name of this property
     * @param value The value of this property
     */
    void setProperty(String name, Scalar value);

    /**
     * Set a multivalued valued property state on this node state.
     *
     * @param name The name of this property
     * @param values The value of this property
     */
    void setProperty(String name, List<Scalar> values);

    /**
     * Remove a property from this node state
     * @param name name of the property
     */
    void removeProperty(String name);

    /**
     * Move the node state located at {@code sourcePath} to a node
     * state at {@code destPath}. Do noting if either the source
     * does not exist, the parent of the destination does not exist
     * of the destination exists already.
     *
     * @param sourcePath source path relative to this node state
     * @param destPath destination path relative to this node state
     */
    void move(String sourcePath, String destPath);

    /**
     * Copy the node state located at {@code sourcePath} to a node
     * state at {@code destPath}. Do noting if either the source
     * does not exist, the parent of the destination does not exist
     * of the destination exists already.
     *
     * @param sourcePath source path relative to this node state
     * @param destPath destination path relative to this node state
     */
    void copy(String sourcePath, String destPath);

    /**
     * Edit the child node state with the given {@code name}.
     * @param name name of the child node state to edit.<commit_msg>OAK-18: Define Oak API  Javadoc<commit_after>/*
 * 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.api;

import java.util.List;

/**
 * An editor for modifying existing and creating new
 * {@link NodeState node states}.
 */
public interface NodeStateEditor {

    /**
     * Add the child node state with the given {@code name}. Does nothing
     * if such a child node already exists.
     * @param name name of the new node state
     */
    void addNode(String name);

    /**
     * Remove the child node state with the given {@code name}. Does nothing
     * if no such child node exists.
     * @param name  name of the node state to remove
     */
    void removeNode(String name);

    /**
     * Set a single valued property state on this node state.
     *
     * @param name The name of this property
     * @param value The value of this property
     */
    void setProperty(String name, Scalar value);

    /**
     * Set a multivalued valued property state on this node state.
     *
     * @param name The name of this property
     * @param values The value of this property
     */
    void setProperty(String name, List<Scalar> values);

    /**
     * Remove a property from this node state
     * @param name name of the property
     */
    void removeProperty(String name);

    /**
     * Move the node state located at {@code sourcePath} to a node
     * state at {@code destPath}. Do noting if either the source
     * does not exist, the parent of the destination does not exist
     * or the destination exists already. Both paths must resolve
     * to node states located in the subtree below the transient
     * state this editor is acting upon.
     *
     * @param sourcePath source path relative to this node state
     * @param destPath destination path relative to this node state
     */
    void move(String sourcePath, String destPath);

    /**
     * Copy the node state located at {@code sourcePath} to a node
     * state at {@code destPath}. Do noting if either the source
     * does not exist, the parent of the destination does not exist
     * or the destination exists already. Both paths must resolve
     * to node states located in the subtree below the transient
     * state this editor is acting upon.
     *
     * @param sourcePath source path relative to this node state
     * @param destPath destination path relative to this node state
     */
    void copy(String sourcePath, String destPath);

    /**
     * Edit the child node state with the given {@code name}.
     * @param name name of the child node state to edit.
{'fraction_non_alphanumeric': 0.06773894215898546, 'fraction_numerical': 0.001546551190844417, 'mean_word_length': 2.784084259801053, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5014083', 'n_tokens_mistral': 1615, 'n_tokens_neox': 1588, 'n_words': 855}