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.InstanceIdentifier.NodeIdentifier;
11 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
12 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
13 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
14 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
15 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
17
18 public class SchemaAwareApplyOperationRoot extends SchemaAwareApplyOperation.DataNodeContainerModificationStrategy<ContainerSchemaNode> {
19
20     private final SchemaContext context;
21
22     public SchemaAwareApplyOperationRoot(final SchemaContext context) {
23         super(context,ContainerNode.class);
24         this.context = context;
25     }
26
27     @Override
28     protected DataContainerNodeBuilder createBuilder(final PathArgument identifier) {
29         return ImmutableContainerNodeBuilder.create().withNodeIdentifier((NodeIdentifier) identifier);
30     }
31
32     public SchemaContext getContext() {
33         return context;
34     }
35
36     @Override
37     public String toString() {
38         return "SchemaAwareApplyOperationRoot [context=" + context + "]";
39     }
40
41 }

©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.