Rework BindingRuntimeTypes
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / RpcInputGenerator.java
diff --git a/binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/RpcInputGenerator.java b/binding/mdsal-binding-generator/src/main/java/org/opendaylight/mdsal/binding/generator/impl/reactor/RpcInputGenerator.java
new file mode 100644 (file)
index 0000000..c3a15e9
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2021 PANTHEON.tech, 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.mdsal.binding.generator.impl.reactor;
+
+import org.opendaylight.mdsal.binding.generator.impl.reactor.CollisionDomain.Member;
+import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
+
+/**
+ * Specialization for legacy RPC services.
+ */
+// FIXME: hide this once we have RpcRuntimeType
+public final class RpcInputGenerator extends InputGenerator {
+    RpcInputGenerator(final InputEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
+        super(statement, parent);
+    }
+
+    @Override
+    CollisionDomain parentDomain() {
+        return getParent().parentDomain();
+    }
+
+    @Override
+    AbstractCompositeGenerator<?, ?> getPackageParent() {
+        return getParent().getParent();
+    }
+
+    @Override
+    Member createMember(final CollisionDomain domain) {
+        return domain.addSecondary(this, getParent().ensureMember());
+    }
+}