Merge "Bug 849: Fixed NPE in Translated Data Change Events."
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / SchemaAwareApplyOperationRoot.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;
9
10 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
13 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
14 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
15 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
16
17 public class SchemaAwareApplyOperationRoot extends SchemaAwareApplyOperation.DataNodeContainerModificationStrategy<ContainerSchemaNode> {
18     private final SchemaContext context;
19
20     public SchemaAwareApplyOperationRoot(final SchemaContext context) {
21         super(context,ContainerNode.class);
22         this.context = context;
23     }
24
25     public SchemaContext getContext() {
26         return context;
27     }
28
29     @Override
30     public String toString() {
31         return "SchemaAwareApplyOperationRoot [context=" + context + "]";
32     }
33
34     @Override
35     @SuppressWarnings("rawtypes")
36     protected DataContainerNodeBuilder createBuilder(NormalizedNode<?, ?> original) {
37         return ImmutableContainerNodeBuilder.create((ContainerNode) original);
38     }
39 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.