Rework AugmentRuntimeType and Choice/Case linkage
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / InputGenerator.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.DefaultInputRuntimeType;
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.InputRuntimeType;
16 import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
17 import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
18
19 /**
20  * Generator corresponding to an {@code input} statement.
21  */
22 class InputGenerator extends OperationContainerGenerator<InputEffectiveStatement, InputRuntimeType> {
23     InputGenerator(final InputEffectiveStatement statement, final AbstractCompositeGenerator<?, ?> parent) {
24         super(statement, parent, BindingTypes.RPC_INPUT);
25     }
26
27     @Override
28     final CompositeRuntimeTypeBuilder<InputEffectiveStatement, InputRuntimeType> createBuilder(
29             final InputEffectiveStatement statement) {
30         return new CompositeRuntimeTypeBuilder<>(statement) {
31             @Override
32             InputRuntimeType build(final GeneratedType type, final InputEffectiveStatement statement,
33                     final List<RuntimeType> children, final List<AugmentRuntimeType> augments) {
34                 return new DefaultInputRuntimeType(type, statement, children, augments);
35             }
36         };
37     }
38 }