Remove AbstractEffectiveOperationDefinition 34/87434/3
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Feb 2020 22:01:07 +0000 (23:01 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 5 Feb 2020 01:08:01 +0000 (02:08 +0100)
With RPC/Action statements migrated, this abstract class has no
users, remove it.

JIRA: YANGTOOLS-652
Change-Id: I458df84652ffb5b2801c1d47f9a46928b263545b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveOperationDefinition.java [deleted file]

diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveOperationDefinition.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveOperationDefinition.java
deleted file mode 100644 (file)
index 0f8a71d..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2018 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;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Verify;
-import com.google.common.collect.ImmutableSet;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
-import org.opendaylight.yangtools.yang.model.api.OperationDefinition;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.OutputEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypedefEffectiveStatement;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-
-@Deprecated(forRemoval = true)
-public abstract class AbstractEffectiveOperationDefinition<D extends DeclaredStatement<QName>>
-        extends AbstractEffectiveSchemaNode<D> implements OperationDefinition {
-    private final ImmutableSet<TypeDefinition<?>> typeDefinitions;
-    private final ImmutableSet<GroupingDefinition> groupings;
-    private final ContainerSchemaNode input;
-    private final ContainerSchemaNode output;
-
-    protected AbstractEffectiveOperationDefinition(final StmtContext<QName, D, ?> ctx) {
-        super(ctx);
-        input = findAsContainer(this, InputEffectiveStatement.class);
-        output = findAsContainer(this, OutputEffectiveStatement.class);
-
-        // initSubstatements
-        final Set<GroupingDefinition> groupingsInit = new HashSet<>();
-        final Set<TypeDefinition<?>> mutableTypeDefinitions = new LinkedHashSet<>();
-        for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
-            if (effectiveStatement instanceof GroupingDefinition
-                    && !groupingsInit.add((GroupingDefinition) effectiveStatement)) {
-                throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
-            }
-            if (effectiveStatement instanceof TypedefEffectiveStatement) {
-                final TypeDefinition<?> type = ((TypedefEffectiveStatement) effectiveStatement).getTypeDefinition();
-                if (!mutableTypeDefinitions.add(type)) {
-                    throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
-                }
-            }
-        }
-        this.groupings = ImmutableSet.copyOf(groupingsInit);
-        this.typeDefinitions = ImmutableSet.copyOf(mutableTypeDefinitions);
-    }
-
-    private static ContainerSchemaNode findAsContainer(final EffectiveStatement<?, ?> parent,
-            final Class<? extends EffectiveStatement<QName, ?>> statementType) {
-        final EffectiveStatement<?, ?> statement = parent.findFirstEffectiveSubstatement(statementType).get();
-        Verify.verify(statement instanceof ContainerSchemaNode, "Child statement %s is not a ContainerSchemaNode");
-        return (ContainerSchemaNode) statement;
-    }
-
-    @Override
-    public final ContainerSchemaNode getInput() {
-        return input;
-    }
-
-    @Override
-    public final ContainerSchemaNode getOutput() {
-        return output;
-    }
-
-    @Override
-    public final Set<TypeDefinition<?>> getTypeDefinitions() {
-        return typeDefinitions;
-    }
-
-    @Override
-    public final Set<GroupingDefinition> getGroupings() {
-        return groupings;
-    }
-
-    @Override
-    public final String toString() {
-        return MoreObjects.toStringHelper(this).add("qname", getQName()).add("path", getPath()).add("input", input)
-                .add("output", output).toString();
-    }
-}