Fix checkstyle in mdsal-binding-dom-codec
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / CaseNodeCodecContext.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.mdsal.binding.dom.codec.impl;
9
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;
18
19 final class CaseNodeCodecContext<D extends DataObject> extends DataObjectCodecContext<D,ChoiceCaseNode> {
20     CaseNodeCodecContext(final DataContainerCodecPrototype<ChoiceCaseNode> prototype) {
21         super(prototype);
22     }
23
24     @Override
25     protected void addYangPathArgument(final PathArgument arg,
26             final List<YangInstanceIdentifier.PathArgument> builder) {
27         // NOOP
28     }
29
30     @Override
31     public D deserialize(final NormalizedNode<?, ?> normalizedNode) {
32         Preconditions.checkState(normalizedNode instanceof ChoiceNode);
33         return createBindingProxy((ChoiceNode) normalizedNode);
34     }
35
36     @Override
37     protected Object deserializeObject(final NormalizedNode<?, ?> normalizedNode) {
38         return deserialize(normalizedNode);
39     }
40
41     @Override
42     public YangInstanceIdentifier.PathArgument serializePathArgument(final PathArgument arg) {
43         Preconditions.checkArgument(arg == null);
44         return null;
45     }
46
47     @Override
48     public PathArgument deserializePathArgument(final YangInstanceIdentifier.PathArgument arg) {
49         Preconditions.checkArgument(arg == null);
50         return null;
51     }
52 }