2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.binding.data.codec.impl;
10 import com.google.common.base.Preconditions;
11 import java.util.List;
12 import org.opendaylight.yangtools.yang.binding.DataObject;
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
14 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
18 final class CaseNodeCodecContext<D extends DataObject> extends DataObjectCodecContext<D,ChoiceCaseNode> {
19 public CaseNodeCodecContext(final DataContainerCodecPrototype<ChoiceCaseNode> prototype) {
24 protected void addYangPathArgument(final PathArgument arg,
25 final List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> builder) {
30 public D deserialize(final NormalizedNode<?, ?> normalizedNode) {
31 Preconditions.checkState(normalizedNode instanceof ChoiceNode);
32 return createBindingProxy((ChoiceNode) normalizedNode);
36 protected Object deserializeObject(NormalizedNode<?, ?> normalizedNode) {
37 return deserialize(normalizedNode);
41 public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument serializePathArgument(
43 Preconditions.checkArgument(arg == null);
48 public PathArgument deserializePathArgument(
49 org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg) {
50 Preconditions.checkArgument(arg == null);