Seal TypedDataSchemaNode 66/101266/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 23 May 2022 16:49:04 +0000 (18:49 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 23 May 2022 17:27:26 +0000 (17:27 +0000)
TypedDataSchemaNode is the common interface for Leaf(List)SchemaNode
and should not be used separately. Make sure we seal it.

Change-Id: Icf5592dc6e6906d9f828b9ed2090094d69527431
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafListSchemaNode.java
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/LeafSchemaNode.java
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/TypedDataSchemaNode.java

index f4ac0a103ee48aa12bde6ef0ba577c17632c3d92..979ab7f5f9035d5eafcc03bfca324ffee8702e94 100644 (file)
@@ -14,8 +14,8 @@ import org.opendaylight.yangtools.yang.model.api.stmt.LeafListEffectiveStatement
 /**
  * Interface describing YANG 'leaf-list' statement.
  */
-public interface LeafListSchemaNode extends TypedDataSchemaNode, MustConstraintAware, ElementCountConstraintAware,
-        UserOrderedAware<LeafListEffectiveStatement> {
+public non-sealed interface LeafListSchemaNode extends TypedDataSchemaNode, MustConstraintAware,
+        ElementCountConstraintAware, UserOrderedAware<LeafListEffectiveStatement> {
 
     /**
      * Return the default value of this leaf-list, as per the rules outlined in
index 6a3eb9f852628a6b3f87ee4d5949c35fd8527d07..b80b22aa3211ab1287ae80b93d9ef5501a045fc9 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement;
  * Since we are presenting the effective model of the world, the information dictated by 'default' and 'units'
  * substatements is captured in the type returned via {@link #getType()}.
  */
-public interface LeafSchemaNode extends TypedDataSchemaNode, MandatoryAware, MustConstraintAware,
+public non-sealed interface LeafSchemaNode extends TypedDataSchemaNode, MandatoryAware, MustConstraintAware,
         EffectiveStatementEquivalent<LeafEffectiveStatement> {
 
 }
index f6ff17dc4aa83bfb3e9cb6fcbf7cc6dd09e9442b..c58e8941ab21e40816524cc4886f6e0e818c9d4b 100644 (file)
@@ -13,7 +13,8 @@ package org.opendaylight.yangtools.yang.model.api;
  *
  * @author Robert Varga
  */
-public interface TypedDataSchemaNode extends DataSchemaNode, TypeAware {
+public sealed interface TypedDataSchemaNode extends DataSchemaNode, TypeAware
+        permits LeafSchemaNode, LeafListSchemaNode {
     /**
      * Returns type of the instance which implements <code>DataSchemaNode</code>.
      *