Drop unneeded generic type specifiers
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / AbstractLeafCandidateNode.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 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;
18
19 abstract class AbstractLeafCandidateNode implements DataTreeCandidateNode {
20     private final NormalizedNode<?, ?> data;
21
22     protected AbstractLeafCandidateNode(final NormalizedNode<?, ?> data) {
23         this.data = Preconditions.checkNotNull(data);
24     }
25
26     protected final Optional<NormalizedNode<?, ?>> dataOptional() {
27         return Optional.of(data);
28     }
29
30     @Override
31     public final Collection<DataTreeCandidateNode> getChildNodes() {
32         return Collections.emptyList();
33     }
34
35     @Override
36     @Nonnull
37     public final PathArgument getIdentifier() {
38         return data.getIdentifier();
39     }
40
41     @Override
42     public final DataTreeCandidateNode getModifiedChild(final PathArgument identifier) {
43         return null;
44     }
45 }