2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.tree.spi;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.collect.ImmutableList;
13 import java.util.Collection;
14 import java.util.Optional;
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.tree.api.DataTreeCandidateNode;
18 import org.opendaylight.yangtools.yang.data.tree.api.ModificationType;
20 final class EmptyDataTreeCandidateNode implements DataTreeCandidateNode {
21 private final PathArgument identifier;
23 EmptyDataTreeCandidateNode(final PathArgument identifier) {
24 this.identifier = requireNonNull(identifier, "Identifier should not be null");
28 public PathArgument getIdentifier() {
33 public Collection<DataTreeCandidateNode> getChildNodes() {
34 return ImmutableList.of();
38 public Optional<DataTreeCandidateNode> getModifiedChild(final PathArgument childIdentifier) {
39 return Optional.empty();
43 public ModificationType getModificationType() {
44 return ModificationType.UNMODIFIED;
48 public Optional<NormalizedNode> getDataAfter() {
49 return Optional.empty();
53 public Optional<NormalizedNode> getDataBefore() {
54 return Optional.empty();