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)
*/
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,
*/
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,
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.
* @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();
-
}
}
@Override
- @Deprecated
public boolean isAugmenting() {
return (operations & IS_AUGMENTING_BITS) != 0;
}
@Override
- @Deprecated
public boolean isAddedByUses() {
return (operations & IS_ADDED_BY_USES_BITS) != 0;
}