Merge "BUG-624 make netconf tcp address optional in config.ini with default value...
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / tree / spi / AbstractTreeNode.java
1 /*
2  * Copyright (c) 2014 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.controller.md.sal.dom.store.impl.tree.spi;
9
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12
13 import com.google.common.base.Preconditions;
14
15 /*
16  * A very basic data tree node.
17  */
18 abstract class AbstractTreeNode implements TreeNode {
19     private final NormalizedNode<?, ?> data;
20     private final Version version;
21
22     protected AbstractTreeNode(final NormalizedNode<?, ?> data, final Version version) {
23         this.data = Preconditions.checkNotNull(data);
24         this.version = Preconditions.checkNotNull(version);
25     }
26
27     @Override
28     public PathArgument getIdentifier() {
29         return data.getIdentifier();
30     }
31
32     @Override
33     public final Version getVersion() {
34         return version;
35     }
36
37     @Override
38     public final NormalizedNode<?, ?> getData() {
39         return data;
40     }
41 }