Un-deprecate CopyableNode, AddedByUsesAware 46/95346/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 Feb 2021 15:15:34 +0000 (16:15 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 24 Feb 2021 11:40:02 +0000 (12:40 +0100)
These traits seem to provide a useful inference summary, related to
DerivableSchemaNode. Un-deprecate them for now to reduce noise for
valid uses which have no alternative.

Also add FIXMEs to reconsider overall design of these interfaces,
as better semantic integration allows for more consistent use.

Change-Id: I3d238f9c6f8d74769506202777efb82277546e63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 76943f2ec79511177e9fddc4c2f4a888ccfb0b09)

yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/AddedByUsesAware.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/CopyableNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/DerivableSchemaNode.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/CopyHistory.java

index 94a91bdce70b2ffa90994713477fd4725e83f2c9..d7e43c49b946c888ffb186e3262eda297456b45f 100644 (file)
@@ -7,13 +7,13 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
+import com.google.common.annotations.Beta;
+
 /**
  * Trait interface for {@link SchemaNode}s, which have the {@link #isAddedByUses()} method.
- *
- * @deprecated This interface relates to declared model rather than to effective mode and as such should not
- *             exist. It is provided to provide common method definition and eash migration of users.
  */
-@Deprecated
+@Beta
+//FIXME: 8.0.0: refactor this interface to take into account DerivableSchemaNode
 public interface AddedByUsesAware {
     /**
      * Returns <code>true</code> if this node was added by uses statement,
index b7f38a8426f06d75e8e5e826c2587875e1015995..34c92e73978ff28b02e4f38acf85e99b5020a30e 100644 (file)
@@ -7,16 +7,13 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
+import com.google.common.annotations.Beta;
 
 /**
  * Represents a node that can be added by uses or by augmentation.
- *
- * @deprecated Aside from the deprecated {@link AddedByUsesAware} contract, this interface adds only a trait related
- *             to now how we arrived at this effective node. Users who need to know this information should really be
- *             looking at the {@link DeclaredStatement} world, which holds the original node definition.
  */
-@Deprecated
+@Beta
+// FIXME: 8.0.0: refactor this interface to take into account DerivableSchemaNode
 public interface CopyableNode extends AddedByUsesAware {
     /**
      * Returns <code>true</code> if this node was added by augmentation,
index 2aaa58f1b2065669dff1e1c703f9764034322100..7dd80983ad99e4ff258c12cadc6ca721422b4fc5 100644 (file)
@@ -10,12 +10,10 @@ package org.opendaylight.yangtools.yang.model.api;
 import java.util.Optional;
 
 /**
- * Schema Node which may be derived from other schema node
- * using augmentation or uses statement.
- *
+ * Schema Node which may be derived from other schema node using augmentation or uses statement.
  */
+// FIXME: 8.0.0: refactor this interface to take into account CopyableNode and AddedByUsesAware
 public interface DerivableSchemaNode extends DataSchemaNode {
-
     /**
      * If this node is added by uses, returns original node definition from
      * grouping where it was defined.
@@ -23,6 +21,6 @@ public interface DerivableSchemaNode extends DataSchemaNode {
      * @return original node definition from grouping if this node is added by
      *         uses, Optional.absent otherwise
      */
+    // FIXME: 8.0.0: this should be a type capture as it always matches this node's type
     Optional<? extends SchemaNode> getOriginal();
-
 }
index 5b039d6e239ee417a7acb7111dcf37000ab2123e..6c4cee83aeef607cd21579a1241e7eb220640d9f 100644 (file)
@@ -99,13 +99,11 @@ public final class CopyHistory implements Immutable, CopyableNode {
     }
 
     @Override
-    @Deprecated
     public boolean isAugmenting() {
         return (operations & IS_AUGMENTING_BITS) != 0;
     }
 
     @Override
-    @Deprecated
     public boolean isAddedByUses() {
         return (operations & IS_ADDED_BY_USES_BITS) != 0;
     }