Populate data/ hierarchy
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / EmptyDataTreeCandidateNode.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.api.schema.tree;
9
10 import static java.util.Objects.requireNonNull;
11
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
18 final class EmptyDataTreeCandidateNode implements DataTreeCandidateNode {
19     private final PathArgument identifier;
20
21     EmptyDataTreeCandidateNode(final PathArgument identifier) {
22         this.identifier = requireNonNull(identifier, "Identifier should not be null");
23     }
24
25     @Override
26     public PathArgument getIdentifier() {
27         return identifier;
28     }
29
30     @Override
31     public Collection<DataTreeCandidateNode> getChildNodes() {
32         return ImmutableList.of();
33     }
34
35     @Override
36     public Optional<DataTreeCandidateNode> getModifiedChild(final PathArgument childIdentifier) {
37         return Optional.empty();
38     }
39
40     @Override
41     public ModificationType getModificationType() {
42         return ModificationType.UNMODIFIED;
43     }
44
45     @Override
46     public Optional<NormalizedNode> getDataAfter() {
47         return Optional.empty();
48     }
49
50     @Override
51     public Optional<NormalizedNode> getDataBefore() {
52         return Optional.empty();
53     }
54 }