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 javax.annotation.Nonnull;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
19 abstract class AbstractLeafCandidateNode implements DataTreeCandidateNode {
20 private final NormalizedNode<?, ?> data;
22 protected AbstractLeafCandidateNode(final NormalizedNode<?, ?> data) {
23 this.data = Preconditions.checkNotNull(data);
26 protected final Optional<NormalizedNode<?, ?>> dataOptional() {
27 return Optional.of(data);
31 public final Collection<DataTreeCandidateNode> getChildNodes() {
32 return Collections.emptyList();
37 public final PathArgument getIdentifier() {
38 return data.getIdentifier();
42 public final DataTreeCandidateNode getModifiedChild(final PathArgument identifier) {