Remove duplicate {Declared,Effective}Statement methods 91/81191/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 26 Mar 2019 14:15:03 +0000 (15:15 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 26 Mar 2019 14:39:10 +0000 (15:39 +0100)
EffectiveStatementBase and AbstractDeclaredStatement pre-date
our use of Java 8 and provided methods to access substatements.

These methods are now part of interface contract, so we can safely
remove their old counterparts.

Change-Id: I10a3b0b3b280af1d41849f7f4f7ef97acb84da39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/EffectiveStatementBase.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/AbstractDeclaredStatement.java

index f4af43a2d6da3795c4eccebc4d3b3ad65759f86d..ee874e12b2f2c197c76f8b0f1b6d8cedb3d921b0 100644 (file)
@@ -96,19 +96,6 @@ public abstract class EffectiveStatementBase<A, D extends DeclaredStatement<A>>
         return substatements;
     }
 
-    /**
-     * Find first substatement of specified type.
-     *
-     * @param type Requested type
-     * @return First matching substatement, or null if no match is found.
-     *
-     * @deprecated Use {@link #findFirstEffectiveSubstatement(Class)} instead.
-     */
-    @Deprecated
-    public final <S extends EffectiveStatement<?, ?>> S firstEffective(final Class<S> type) {
-        return findFirstEffectiveSubstatement(type).orElse(null);
-    }
-
     protected final <S extends SchemaNode> S firstSchemaNode(final Class<S> type) {
         return substatements.stream().filter(type::isInstance).findFirst().map(type::cast).orElse(null);
     }
index 7f4c451d503f1d32ba9092eeb9ea1fa71ab11229..c10cf9ea4a9d158dcd9cde8a71e9280a9cef2dd1 100644 (file)
@@ -41,18 +41,6 @@ public abstract class AbstractDeclaredStatement<A> implements DeclaredStatement<
             StmtContext::buildDeclared));
     }
 
-    /**
-     * Find first declared substatement of a particular type.
-     *
-     * @param type {@link DeclaredStatement} type
-     * @return First effective substatement, or null if no match is found.
-     * @deprecated Use {@link #findFirstDeclaredSubstatement(Class)} instead.
-     */
-    @Deprecated
-    protected final <S extends DeclaredStatement<?>> S firstDeclared(final Class<S> type) {
-        return findFirstDeclaredSubstatement(type).orElse(null);
-    }
-
     @Override
     public String rawArgument() {
         return rawArgument;
@@ -77,18 +65,4 @@ public abstract class AbstractDeclaredStatement<A> implements DeclaredStatement<
     public StatementSource getStatementSource() {
         return source;
     }
-
-    /**
-     * Returns collection of explicitly declared child statements, while preserving its original ordering from original
-     * source.
-     *
-     * @param type {@link DeclaredStatement} type
-     * @return Collection of statements, which were explicitly declared in source of model.
-     * @throws NullPointerException if {@code type} is null
-     * @deprecated Use {@link #declaredSubstatements(Class)} instead.
-     */
-    @Deprecated
-    protected final <S extends DeclaredStatement<?>> Collection<? extends S> allDeclared(final Class<S> type) {
-        return declaredSubstatements(type);
-    }
 }