2 * Copyright (c) 2014 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.yangtools.yang.data.api.schema.tree.spi;
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
15 import com.google.common.base.Optional;import java.lang.Override;import java.lang.String;import java.lang.UnsupportedOperationException;
18 * Concretization of AbstractTreeNode for leaf nodes which only contain data.
19 * Instances of this class report all children as absent, subtree version
20 * equal to this node's version and do not support mutable view.
22 final class ValueNode extends AbstractTreeNode {
23 private static final Logger LOG = LoggerFactory.getLogger(ValueNode.class);
25 protected ValueNode(final NormalizedNode<?, ?> data, final Version version) {
30 public Optional<TreeNode> getChild(final PathArgument childId) {
31 LOG.warn("Attempted to access child {} of value-node {}", childId, this);
32 return Optional.absent();
36 public Version getSubtreeVersion() {
41 public MutableTreeNode mutable() {
43 * Value nodes can only we read/written/delete, which does a straight
44 * replace. That means they don't haver need to be made mutable.
46 throw new UnsupportedOperationException(String.format("Attempted to mutate value-node %s", this));