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.api.schema.tree;
10 import static java.util.Objects.requireNonNull;
12 import java.util.Collection;
13 import java.util.List;
14 import java.util.Optional;
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
17 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 abstract class AbstractLeafCandidateNode implements DataTreeCandidateNode {
20 private final NormalizedNode data;
22 AbstractLeafCandidateNode(final NormalizedNode data) {
23 this.data = requireNonNull(data);
26 final @NonNull Optional<NormalizedNode> dataOptional() {
27 return Optional.of(data);
31 public final Collection<DataTreeCandidateNode> getChildNodes() {
36 public final PathArgument getIdentifier() {
37 return data.getIdentifier();
41 public final Optional<DataTreeCandidateNode> getModifiedChild(final PathArgument identifier) {
42 requireNonNull(identifier);
43 return Optional.empty();