2 * Copyright (c) 2015 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.impl.schema.tree;
10 import com.google.common.base.Optional;
11 import com.google.common.base.Preconditions;
12 import java.util.Collection;
13 import java.util.Collections;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
18 abstract class AbstractLeafCandidateNode implements DataTreeCandidateNode {
19 private final NormalizedNode<?, ?> data;
21 protected AbstractLeafCandidateNode(final NormalizedNode<?, ?> data) {
22 this.data = Preconditions.checkNotNull(data);
25 protected final Optional<NormalizedNode<?, ?>> dataOptional() {
26 return Optional.<NormalizedNode<?, ?>>of(data);
30 public final Collection<DataTreeCandidateNode> getChildNodes() {
31 return Collections.emptyList();
35 public final PathArgument getIdentifier() {
36 return data.getIdentifier();
40 public final DataTreeCandidateNode getModifiedChild(final PathArgument identifier) {