Merge "Bug 2846 - Ordered-by user is broken again - SFC is broken"
[yangtools.git] / code-generator / binding-data-codec / src / main / java / org / opendaylight / yangtools / binding / data / codec / impl / ContainerNodeCodecContext.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.yangtools.binding.data.codec.impl;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
14
15 final class ContainerNodeCodecContext extends DataObjectCodecContext<ContainerSchemaNode> {
16
17     ContainerNodeCodecContext(final DataContainerCodecPrototype<ContainerSchemaNode> prototype) {
18         super(prototype);
19     }
20
21     @Override
22     protected Object dataFromNormalizedNode(final NormalizedNode<?, ?> data) {
23         Preconditions.checkState(data instanceof ContainerNode);
24         return createBindingProxy((ContainerNode) data);
25     }
26
27 }