Cleanup use of Guava library
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / RecursiveUnmodifiedCandidateNode.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.impl.schema.tree;
9
10 import java.util.Optional;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType;
17
18 final class RecursiveUnmodifiedCandidateNode extends AbstractRecursiveCandidateNode {
19     protected RecursiveUnmodifiedCandidateNode(
20             final NormalizedNodeContainer<?, PathArgument, NormalizedNode<?, ?>> data) {
21         super(data);
22     }
23
24     @Override
25     @Nonnull
26     public ModificationType getModificationType() {
27         return ModificationType.UNMODIFIED;
28     }
29
30     @Nonnull
31     @Override
32     public Optional<NormalizedNode<?, ?>> getDataAfter() {
33         return dataOptional();
34     }
35
36     @Nonnull
37     @Override
38     public Optional<NormalizedNode<?, ?>> getDataBefore() {
39         return dataOptional();
40     }
41
42     @Override
43     DataTreeCandidateNode createContainer(
44             final NormalizedNodeContainer<?, PathArgument, NormalizedNode<?, ?>> childData) {
45         return new RecursiveUnmodifiedCandidateNode(childData);
46     }
47
48     @Override
49     DataTreeCandidateNode createLeaf(final NormalizedNode<?, ?> childData) {
50         return new UnmodifiedLeafCandidateNode(childData);
51     }
52 }