Seal ArgumentDefinition 05/100505/9
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 9 Apr 2022 19:44:54 +0000 (21:44 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 25 Apr 2022 12:09:16 +0000 (14:09 +0200)
There are only two possible subclasses. Make sure the compiler
understands that.

Change-Id: Ifa71f15c19dd0dd830ade454be04bdf380abea2b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/ArgumentDefinition.java

index 194426ca97e70ed47638c44c3e0a5a052c15ecea..288e68935827b2744f7413382d483d57578d9d50 100644 (file)
@@ -18,7 +18,7 @@ import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.common.QName;
 
 @Beta
-public abstract class ArgumentDefinition implements Immutable {
+public abstract sealed class ArgumentDefinition implements Immutable {
     private static final class YinAttribute extends ArgumentDefinition {
         YinAttribute(final QName argumentName) {
             super(argumentName);
@@ -56,7 +56,6 @@ public abstract class ArgumentDefinition implements Immutable {
         return argumentName == null ? Optional.empty() : Optional.of(of(argumentName, yinElement));
     }
 
-
     public final @NonNull QName getArgumentName() {
         return argumentName;
     }