2 * Copyright (c) 2016 Cisco Systems, Inc. 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.nb.rfc8040.services.simple.impl;
10 import com.google.common.collect.ImmutableList;
11 import java.util.Collection;
12 import java.util.List;
13 import java.util.Optional;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.LeafSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
17 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
18 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
19 import org.opendaylight.yangtools.yang.model.api.Status;
20 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
21 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
22 import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
25 * Special case only use by GET restconf/operations (since moment of old Yang
26 * parser and old yang model API removal) to build and use fake leaf like child
29 final class FakeLeafSchemaNode implements LeafSchemaNode {
31 private final SchemaPath path;
34 * Base values for fake leaf schema node.
39 FakeLeafSchemaNode(final QName qname) {
40 this.path = FakeContainerSchemaNode.PATH.createChild(qname);
44 public boolean isAugmenting() {
49 public boolean isAddedByUses() {
54 public boolean isConfiguration() {
59 public QName getQName() {
60 return path.getLastComponent();
64 public SchemaPath getPath() {
69 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
70 throw new UnsupportedOperationException("Not supported.");
74 public Optional<String> getDescription() {
75 throw new UnsupportedOperationException("Not supported operations.");
79 public Optional<String> getReference() {
80 throw new UnsupportedOperationException("Not supported.");
84 public Status getStatus() {
85 throw new UnsupportedOperationException("Not supported.");
89 public TypeDefinition<?> getType() {
90 return BaseTypes.emptyType();
94 public Optional<RevisionAwareXPath> getWhenCondition() {
95 return Optional.empty();
99 public boolean isMandatory() {
100 throw new UnsupportedOperationException("Not supported.");
104 public Collection<MustDefinition> getMustConstraints() {
105 return ImmutableList.of();