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.mdsal.binding.dom.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.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
19 final class CaseNodeCodecContext<D extends DataObject> extends DataObjectCodecContext<D,ChoiceCaseNode> {
20 public CaseNodeCodecContext(final DataContainerCodecPrototype<ChoiceCaseNode> prototype) {
25 protected void addYangPathArgument(final PathArgument arg,
26 final List<YangInstanceIdentifier.PathArgument> builder) {
31 public D deserialize(final NormalizedNode<?, ?> normalizedNode) {
32 Preconditions.checkState(normalizedNode instanceof ChoiceNode);
33 return createBindingProxy((ChoiceNode) normalizedNode);
37 protected Object deserializeObject(final NormalizedNode<?, ?> normalizedNode) {
38 return deserialize(normalizedNode);
42 public YangInstanceIdentifier.PathArgument serializePathArgument(
43 final PathArgument arg) {
44 Preconditions.checkArgument(arg == null);
49 public PathArgument deserializePathArgument(final YangInstanceIdentifier.PathArgument arg) {
50 Preconditions.checkArgument(arg == null);