Un-deprecate CopyableNode, AddedByUsesAware 91/95191/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 16 Feb 2021 15:15:34 +0000 (16:15 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 16 Feb 2021 15:15:34 +0000 (16:15 +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>
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-model-spi/src/main/java/org/opendaylight/yangtools/yang/model/spi/meta/EffectiveStatementMixins.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 ad6b2cf63adc0e5e6acdf2d00972e117bf521f86..383d15ef0ed930a90b323bc509be333ecf5ddd95 100644 (file)
@@ -101,7 +101,6 @@ public final class EffectiveStatementMixins {
     public interface AddedByUsesMixin<A, D extends DeclaredStatement<A>>
             extends EffectiveStatementWithFlags<A, D>, AddedByUsesAware {
         @Override
-        @Deprecated
         default boolean isAddedByUses() {
             return (flags() & FlagsBuilder.ADDED_BY_USES) != 0;
         }
@@ -156,7 +155,6 @@ public final class EffectiveStatementMixins {
      */
     public interface CopyableMixin<A, D extends DeclaredStatement<A>> extends AddedByUsesMixin<A, D>, CopyableNode {
         @Override
-        @Deprecated
         default boolean isAugmenting() {
             return (flags() & FlagsBuilder.AUGMENTING) != 0;
         }
index 8c4086715722bdfbb6f2a12dc2895af9f4d16943..8b4e5846b532e656f0a5ab426e3d762c3df0a04d 100644 (file)
@@ -93,13 +93,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;
     }