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.SchemaPath;
18 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
19 import org.opendaylight.yangtools.yang.model.api.stmt.LeafEffectiveStatement;
20 import org.opendaylight.yangtools.yang.model.ri.type.BaseTypes;
22 final class OperationsLeafSchemaNode extends AbstractOperationDataSchemaNode implements LeafSchemaNode {
23 private final QName qname;
25 OperationsLeafSchemaNode(final RpcDefinition rpc) {
26 this.qname = rpc.getQName();
30 public TypeDefinition<?> getType() {
31 return BaseTypes.emptyType();
35 public QName getQName() {
41 public SchemaPath getPath() {
42 return OperationsContainerSchemaNode.PATH.createChild(getQName());
46 public boolean isMandatory() {
47 // This leaf has to be present
52 public Collection<@NonNull MustDefinition> getMustConstraints() {
53 return Collections.emptySet();
57 public LeafEffectiveStatement asEffectiveStatement() {
58 throw new UnsupportedOperationException();