2 * Copyright (c) 2020 PANTHEON.tech, 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.mdsal.binding.dom.codec.spi;
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.binding.dom.codec.api.BindingLazyContainerNode;
13 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
14 import org.opendaylight.yangtools.yang.binding.Action;
15 import org.opendaylight.yangtools.yang.binding.RpcInput;
16 import org.opendaylight.yangtools.yang.binding.RpcOutput;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
20 public abstract class AbstractBindingNormalizedNodeSerializer implements BindingNormalizedNodeSerializer {
22 public final BindingLazyContainerNode<RpcInput> toLazyNormalizedNodeActionInput(
23 final Class<? extends Action<?, ?, ?>> action, final NodeIdentifier identifier, final RpcInput input) {
24 return new LazyActionInputContainerNode(identifier, input, this, action);
28 public final BindingLazyContainerNode<RpcInput> toLazyNormalizedNodeActionInput(
29 final Class<? extends Action<?, ?, ?>> action, final RpcInput input) {
30 return toLazyNormalizedNodeActionInput(action, actionInputName(action), input);
33 protected abstract @NonNull NodeIdentifier actionInputName(@NonNull Class<? extends Action<?, ?, ?>> action);
36 public final BindingLazyContainerNode<RpcOutput> toLazyNormalizedNodeActionOutput(
37 final Class<? extends Action<?, ?, ?>> action, final NodeIdentifier identifier, final RpcOutput output) {
38 return new LazyActionOutputContainerNode(identifier, output, this, action);
42 public final BindingLazyContainerNode<RpcOutput> toLazyNormalizedNodeActionOutput(
43 final Class<? extends Action<?, ?, ?>> action, final RpcOutput output) {
44 return toLazyNormalizedNodeActionOutput(action, actionOutputName(action), output);
47 protected abstract @NonNull NodeIdentifier actionOutputName(@NonNull Class<? extends Action<?, ?, ?>> action);