2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.ri.stmt;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableList;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.InputStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.OutputStatement;
17 import org.opendaylight.yangtools.yang.model.ri.stmt.impl.decl.EmptyUndeclaredInputStatement;
18 import org.opendaylight.yangtools.yang.model.ri.stmt.impl.decl.EmptyUndeclaredOutputStatement;
19 import org.opendaylight.yangtools.yang.model.ri.stmt.impl.decl.RegularUndeclaredInputStatement;
20 import org.opendaylight.yangtools.yang.model.ri.stmt.impl.decl.RegularUndeclaredOutputStatement;
23 * Static entry point to instantiating {@link DeclaredStatements} covered in the {@code RFC7950} metamodel which are
24 * not really declared, but rather implicit.
28 public final class ImplicitStatements {
29 private ImplicitStatements() {
33 public static InputStatement createInput(final QName argument,
34 final ImmutableList<? extends DeclaredStatement<?>> substatements) {
35 return substatements.isEmpty() ? new EmptyUndeclaredInputStatement(argument)
36 : new RegularUndeclaredInputStatement(argument, substatements);
39 public static OutputStatement createOutput(final QName argument,
40 final ImmutableList<? extends DeclaredStatement<?>> substatements) {
41 return substatements.isEmpty() ? new EmptyUndeclaredOutputStatement(argument)
42 : new RegularUndeclaredOutputStatement(argument, substatements);