Clean up ietf-netconf-monitoring-extension
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / impl / OperationsLeafSchemaNode.java
1 /*
2  * Copyright (c) 2020 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.restconf.nb.rfc8040.rests.services.impl;
9
10 import java.util.Collection;
11 import java.util.Set;
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;
20
21 @Deprecated(forRemoval = true, since = "4.0.0")
22 final class OperationsLeafSchemaNode extends AbstractOperationDataSchemaNode implements LeafSchemaNode {
23     private final QName qname;
24
25     OperationsLeafSchemaNode(final RpcDefinition rpc) {
26         qname = rpc.getQName();
27     }
28
29     @Override
30     public TypeDefinition<?> getType() {
31         return BaseTypes.emptyType();
32     }
33
34     @Override
35     public QName getQName() {
36         return qname;
37     }
38
39     @Override
40     public boolean isMandatory() {
41         // This leaf has to be present
42         return true;
43     }
44
45     @Override
46     public Collection<@NonNull MustDefinition> getMustConstraints() {
47         return Set.of();
48     }
49
50     @Override
51     public LeafEffectiveStatement asEffectiveStatement() {
52         throw new UnsupportedOperationException();
53     }
54 }