2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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 org.opendaylight.yangtools.yang.binding.DataObject;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 * Singleton codec for translating RPCs with implicit input statements, which are not mapped by binding spec v1. Since
15 * there is no equivalent, we always return null.
17 * @author Robert Varga
19 * @param <D> Data object type
21 final class UnmappedRpcInputCodec<D extends DataObject> implements RpcInputCodec<D> {
22 private static final UnmappedRpcInputCodec<?> INSTANCE = new UnmappedRpcInputCodec<>();
24 private UnmappedRpcInputCodec() {
28 @SuppressWarnings("unchecked")
29 static <D extends DataObject> UnmappedRpcInputCodec<D> getInstance() {
30 return (UnmappedRpcInputCodec<D>) INSTANCE;
34 public D deserialize(final NormalizedNode<?, ?> data) {
39 public NormalizedNode<?, ?> serialize(final D data) {
40 throw new UnsupportedOperationException("Serialization of " + data + " not supported");