Remove {Numerical,String}RestrictionsImpl 04/90904/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Jul 2020 22:13:53 +0000 (00:13 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Jul 2020 22:31:55 +0000 (00:31 +0200)
As noted during previous migration, these classesalong with their
support is unused. Furthermore NumericalRestrictions is
mis-declared.

Remove the implementation and drop a FIXME for next major version,
so that we at least fix the definition or decide its overall
future.

Note this concept is probably useful, as it gates towards tasks
which are currently done by AbstractTypeStatementSupport and those
could be split out if we rework interactions with simple built-in
types.

JIRA: YANGTOOLS-1065
Change-Id: Ief43d59dbc541b094ca80e39382f8c0c8767bac2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/TypeStatement.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsEffectiveStatement.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsImpl.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsSupport.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsEffectiveStatement.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsImpl.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsSupport.java [deleted file]

index 02d5c81b4bae6eab44371f8a274afd15f77b5d64..8aaf3ae0efc92d90311aeab98a1c0021801ef5ec 100644 (file)
@@ -30,8 +30,9 @@ public interface TypeStatement extends DeclaredStatement<String> {
     }
 
     @Rfc6020AbnfRule("numerical-restrictions")
+    // FIXME: 6.0.0: this interface does not have an implementation
     interface NumericalRestrictions extends TypeStatement {
-
+        // FIXME: 6.0.0: this is not accurate, 'range' is an optional statement
         default @NonNull RangeStatement getRange() {
             return findFirstDeclaredSubstatement(RangeStatement.class).get();
         }
@@ -50,6 +51,7 @@ public interface TypeStatement extends DeclaredStatement<String> {
     }
 
     @Rfc6020AbnfRule("string-restrictions")
+    // FIXME: 6.0.0: this interface does not have an implementation
     interface StringRestrictions extends TypeStatement {
         default @Nullable LengthStatement getLength() {
             final Optional<LengthStatement> opt = findFirstDeclaredSubstatement(LengthStatement.class);
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsEffectiveStatement.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsEffectiveStatement.java
deleted file mode 100644 (file)
index f81d370..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
-
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.NumericalRestrictions;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.DeclaredEffectiveStatementBase;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
-// FIXME: this class is not used anywhere, decide its future
-final class NumericalRestrictionsEffectiveStatement
-        extends DeclaredEffectiveStatementBase<String, NumericalRestrictions> {
-
-    NumericalRestrictionsEffectiveStatement(final StmtContext<String, NumericalRestrictions, ?> ctx) {
-        super(ctx);
-    }
-}
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsImpl.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsImpl.java
deleted file mode 100644 (file)
index 5de2822..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
-
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.NumericalRestrictions;
-import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
-// FIXME: this class is not used anywhere, decide its future
-final class NumericalRestrictionsImpl extends AbstractDeclaredStatement<String> implements NumericalRestrictions {
-    NumericalRestrictionsImpl(final StmtContext<String, NumericalRestrictions, ?> context) {
-        super(context);
-    }
-}
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsSupport.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/NumericalRestrictionsSupport.java
deleted file mode 100644 (file)
index cc63247..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
-
-import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.NumericalRestrictions;
-import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
-
-// FIXME: this class is not used anywhere, decide its future
-final class NumericalRestrictionsSupport extends
-        AbstractStatementSupport<String, NumericalRestrictions, EffectiveStatement<String, NumericalRestrictions>> {
-    private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(YangStmtMapping
-        .TYPE)
-        .addMandatory(YangStmtMapping.RANGE)
-        .build();
-
-    NumericalRestrictionsSupport() {
-        super(YangStmtMapping.TYPE);
-    }
-
-    @Override
-    public String parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
-        return value;
-    }
-
-    @Override
-    public NumericalRestrictions createDeclared(final StmtContext<String, NumericalRestrictions, ?> ctx) {
-        return new NumericalRestrictionsImpl(ctx);
-    }
-
-    @Override
-    public EffectiveStatement<String, NumericalRestrictions> createEffective(
-            final StmtContext<String, NumericalRestrictions,
-            EffectiveStatement<String, NumericalRestrictions>> ctx) {
-        return new NumericalRestrictionsEffectiveStatement(ctx);
-    }
-
-    @Override
-    protected SubstatementValidator getSubstatementValidator() {
-        return SUBSTATEMENT_VALIDATOR;
-    }
-}
\ No newline at end of file
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsEffectiveStatement.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsEffectiveStatement.java
deleted file mode 100644 (file)
index eba180e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
-
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.StringRestrictions;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.DeclaredEffectiveStatementBase;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
-// FIXME: this class is not used anywhere, decide its future
-final class StringRestrictionsEffectiveStatement
-        extends DeclaredEffectiveStatementBase<String, StringRestrictions> {
-    StringRestrictionsEffectiveStatement(final StmtContext<String, StringRestrictions, ?> ctx) {
-        super(ctx);
-    }
-}
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsImpl.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsImpl.java
deleted file mode 100644 (file)
index ef749e4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
-
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
-// FIXME: this class is not used anywhere, decide its future
-final class StringRestrictionsImpl extends AbstractDeclaredStatement<String> implements
-        TypeStatement.StringRestrictions {
-    StringRestrictionsImpl(final StmtContext<String, StringRestrictions, ?> context) {
-        super(context);
-    }
-}
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsSupport.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/StringRestrictionsSupport.java
deleted file mode 100644 (file)
index 15f6761..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
-
-import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.StringRestrictions;
-import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
-
-//FIXME: this class is not used anywhere, decide its future
-final class StringRestrictionsSupport
-        extends AbstractStatementSupport<String, StringRestrictions, EffectiveStatement<String, StringRestrictions>> {
-    private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(YangStmtMapping
-        .TYPE)
-        .addOptional(YangStmtMapping.LENGTH)
-        .addAny(YangStmtMapping.PATTERN)
-        .build();
-
-    StringRestrictionsSupport() {
-        super(YangStmtMapping.TYPE);
-    }
-
-    @Override
-    public String parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
-        return value;
-    }
-
-    @Override
-    public StringRestrictions createDeclared(final StmtContext<String, StringRestrictions, ?> ctx) {
-        return new StringRestrictionsImpl(ctx);
-    }
-
-    @Override
-    public EffectiveStatement<String, StringRestrictions> createEffective(
-            final StmtContext<String, StringRestrictions, EffectiveStatement<String, StringRestrictions>> ctx) {
-        return new StringRestrictionsEffectiveStatement(ctx);
-    }
-
-    @Override
-    protected SubstatementValidator getSubstatementValidator() {
-        return SUBSTATEMENT_VALIDATOR;
-    }
-}
\ No newline at end of file