Move StatementNamespace to yang.binding.contract
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / InvokableRuntimeTypeBuilder.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 static com.google.common.base.Verify.verify;
11
12 import java.util.List;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.mdsal.binding.model.api.GeneratedType;
15 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
16 import org.opendaylight.mdsal.binding.runtime.api.CompositeRuntimeType;
17 import org.opendaylight.mdsal.binding.runtime.api.RuntimeType;
18 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
19
20 abstract class InvokableRuntimeTypeBuilder<S extends EffectiveStatement<?, ?>, R extends CompositeRuntimeType>
21         extends CompositeRuntimeTypeBuilder<S, R> {
22     InvokableRuntimeTypeBuilder(final S statement) {
23         super(statement);
24     }
25
26     @Override
27     final R build(final GeneratedType type, final S statement, final List<RuntimeType> children,
28             final List<AugmentRuntimeType> augments) {
29         verify(augments.isEmpty(), "Unexpected augments %s", augments);
30         return build(type, statement, children);
31     }
32
33     abstract @NonNull R build(GeneratedType type, S statement, List<RuntimeType> children);
34 }