<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.spi;

import org.apache.jackrabbit.name.Path;

/**
 * <code>ItemId</code>...
 */
public interface ItemId {

    public boolean denotesNode();

    public String getUUID();

    public Path getRelativePath();
}<commit_msg>Add JavaDoc to ItemId.<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.spi;

import org.apache.jackrabbit.name.Path;

/**
 * An <code>ItemId</code> identifies an item using a combination of UUID and
 * relative path. There are three basic forms of an ItemId. The following
 * table shows each of the allowed combinations where an <b>X</b> in
 * the column indicates that a value is set and a <b>-</b> indicates
 * that the value is <code>null</code>:
 * <table>
 * <tr><th>UUID</th><th>relative Path</th><th>Usage</th></tr>
 * <tr><td align="center"><b>X</b></td><td align="center"><b>-</b></td>
 *   <td>The item can be identified with a UUID. In most cases such an item
 *   is also mix:referenceable but there is no restriction in that respect. An
 *   SPI implementation may also use a UUID to identify non-referenceable nodes.
 *   Whether a node is referenceable is purely governed by its node type or
 *   the assigned mixin types.</td></tr>
 * <tr><td align="center"><b>-</b></td><td align="center"><b>X</b></td>
 *   <td>The item can not be identified with a UUID and none of its ancestors
 *   can be identified with a UUID. The item is identified by a relative path
 *   starting from the root node of the workspace as if calling
 *   {@link javax.jcr.Session#getRootNode() Session.getRootNode()}{@link
 *   javax.jcr.Node#getNode(String) .getNode(relPath)}.
 *   </td></tr>
 * <tr><td align="center"><b>X</b></td><td align="center"><b>X</b></td>
 *   <td>The item can not be identified with a UUID but one of its ancestors
 *   can. {@link #getUUID} returns the UUID of the nearest ancestor, which
 *   can be identified with a UUID. The relative path provides a navigation
 *   path from the above mentioned ancestor to the item identified by the
 *   <code>ItemId</code>.
 *   </td></tr>
 * </table>
 */
public interface ItemId {

    /**
     * @return <code>true</code> if this <code>ItemId</code> identifies a node;
     *         otherwise <code>false</code>.
     */
    public boolean denotesNode();

    /**
     * @return the UUID part of this item id or <code>null</code> if the
     *         identified item nor any of its ancestors can be identified with a
     *         UUID.
     */
    public String getUUID();

    /**
     * @return the relative path part of this item id. Returns <code>null</code>
     *         if this item can be identified solely with a UUID.
     */
    public Path getRelativePath();
}
{'fraction_non_alphanumeric': 0.10283194057567317, 'fraction_numerical': 0.0018570102135561746, 'mean_word_length': 3.456049638055843, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, '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': '3109722', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1166, 'n_words': 532}