e39e012ff9d536c0764b5e945c8ff0928390b430
[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 package org.opendaylight.controller.cluster.datastore.node.utils.transformer;
9
10 import com.google.common.base.Optional;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeContainerBuilder;
14 import org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode;
15
16 final class NormalizedNodeBuilderWrapper {
17     private final NormalizedNodeContainerBuilder<?, ?, ?, ?> builder;
18     private final PathArgument identifier;
19     private final Optional<DataSchemaContextNode<?>> schemaNode;
20
21     NormalizedNodeBuilderWrapper(final NormalizedNodeContainerBuilder<?, ?, ?, ?> builder,
22             final PathArgument identifier, final Optional<DataSchemaContextNode<?>> schemaNode) {
23         this.builder = builder;
24         this.identifier = identifier;
25         this.schemaNode = schemaNode;
26     }
27
28     @SuppressWarnings("rawtypes")
29     NormalizedNodeContainerBuilder builder() {
30         return builder;
31     }
32
33     QName nodeType() {
34         return identifier.getNodeType();
35     }
36
37     PathArgument identifier() {
38         return identifier;
39     }
40
41     Optional<DataSchemaContextNode<?>> getSchema() {
42         return schemaNode;
43     }
44 }