Rework AugmentRuntimeType and Choice/Case linkage
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / OutputGenerator.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.generator.impl.reactor;
9
10 import java.util.List;
11 import org.opendaylight.mdsal.binding.generator.impl.rt.DefaultOutputRuntimeType;
12 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
13 import org.opendaylight.mdsal.binding.model.ri.BindingTypes;
14 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
15 import org.opendaylight.mdsal.binding.runtime.api.OutputRuntimeType;
16 import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
17 import org.opendaylight.yangtools.yang.model.api.stmt.OutputEffectiveStatement;
18
19 /**
20  * Generator corresponding to an {@code input} statement.
21  */
22 class OutputGenerator extends OperationContainerGenerator<OutputEffectiveStatement, OutputRuntimeType> {
23     OutputGenerator(final OutputEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
24         super(statement, parent, BindingTypes.RPC_OUTPUT);
25     }
26
27     @Override
28     final CompositeRuntimeTypeBuilder<OutputEffectiveStatement, OutputRuntimeType> createBuilder(
29             final OutputEffectiveStatement statement) {
30         return new CompositeRuntimeTypeBuilder<>(statement) {
31             @Override
32             OutputRuntimeType build(final GeneratedType type, final OutputEffectiveStatement statement,
33                     final List<RuntimeType> children, final List<AugmentRuntimeType> augments) {
34                 return new DefaultOutputRuntimeType(type, statement, children, augments);
35             }
36         };
37     }
38 }