Bug 5485: Improve DataTreeModification pruning on recovery
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / transformer / NormalizedNodeBuilderWrapper.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
9 package org.opendaylight.controller.cluster.datastore.node.utils.transformer;
10
11 import com.google.common.base.Optional;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
15 import org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode;
16
17 public class NormalizedNodeBuilderWrapper {
18     private final NormalizedNodeContainerBuilder<?,?,?,?> builder;
19     private final YangInstanceIdentifier.PathArgument identifier;
20     private final Optional<DataSchemaContextNode<?>> schemaNode;
21
22     NormalizedNodeBuilderWrapper(NormalizedNodeContainerBuilder<?,?,?,?> builder,
23             YangInstanceIdentifier.PathArgument identifier, Optional<DataSchemaContextNode<?>> schemaNode) {
24         this.builder = builder;
25         this.identifier = identifier;
26         this.schemaNode = schemaNode;
27     }
28
29     public NormalizedNodeContainerBuilder builder(){
30         return builder;
31     }
32
33     public QName nodeType(){
34         return identifier.getNodeType();
35     }
36
37     public YangInstanceIdentifier.PathArgument identifier(){
38         return identifier;
39     }
40
41     public Optional<DataSchemaContextNode<?>> getSchema() {
42         return schemaNode;
43     }
44 }