Move more StatementContextBase methods
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / NamespaceBehaviour.java
index 2998f19b0b15a9f3b9415e9c82d0f66590763778..29c33572136f8a51122b7080dd205eedec69a6f0 100644 (file)
@@ -17,11 +17,13 @@ import java.util.Map.Entry;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.yangtools.concepts.AbstractIdentifiable;
+import org.opendaylight.yangtools.concepts.AbstractSimpleIdentifiable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement;
+import org.opendaylight.yangtools.yang.parser.spi.SchemaTreeNamespace;
 
 /**
  * Definition / implementation of specific Identifier Namespace behaviour. A namespace behaviour is built on top
@@ -37,7 +39,7 @@ import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
  * @param <N> Namespace Type
  */
 public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K, V>>
-        extends AbstractIdentifiable<Class<N>> {
+        extends AbstractSimpleIdentifiable<Class<N>> {
 
     public enum StorageNodeType {
         /**
@@ -128,8 +130,14 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
          * This method must not change its mind about a child's presence -- once it returns non-present, it has to be
          * always returning non-present.
          *
+         * <p>
+         * The results produced by this method are expected to be consistent with
+         * {@link SchemaTreeAwareEffectiveStatement#findSchemaTreeNode(QName)} and
+         * {@link SchemaTreeNamespace#getFrom(NamespaceStorageNode, QName)}.
+         *
          * @param qname node identifier of the child being requested
          * @return Requested child, if it is present.
+         * @throws NullPointerException in {@code qname} is null
          */
         <D extends DeclaredStatement<QName>, E extends EffectiveStatement<QName, D>>
             @Nullable StmtContext<QName, D, E> requestSchemaTreeChild(QName qname);
@@ -281,7 +289,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
     }
 
     static final class StorageSpecific<K, V, N extends IdentifierNamespace<K, V>> extends NamespaceBehaviour<K, V, N> {
-        StorageNodeType storageType;
+        private final StorageNodeType storageType;
 
         StorageSpecific(final Class<N> identifier, final StorageNodeType type) {
             super(identifier);