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.restconf.common.util;
10 import java.util.Collection;
11 import java.util.Collections;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
15 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
16 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
17 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
18 import org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement;
19 import org.opendaylight.yangtools.yang.model.ri.type.BaseTypes;
21 final class OperationsLeafSchemaNode extends AbstractOperationDataSchemaNode implements LeafSchemaNode {
22 private final QName qname;
24 OperationsLeafSchemaNode(final RpcDefinition rpc) {
25 qname = rpc.getQName();
29 public TypeDefinition<?> getType() {
30 return BaseTypes.emptyType();
34 public QName getQName() {
39 public boolean isMandatory() {
40 // This leaf has to be present
45 public Collection<@NonNull MustDefinition> getMustConstraints() {
46 return Collections.emptySet();
50 public LeafEffectiveStatement asEffectiveStatement() {
51 throw new UnsupportedOperationException();