import java.util.Map.Entry;
import java.util.concurrent.ExecutionException;
import org.opendaylight.mdsal.binding.dom.adapter.invoke.RpcServiceInvoker;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingLazyContainerNode;
import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
}
private DataObject deserialize(final SchemaPath rpcPath, final NormalizedNode<?, ?> input) {
- if (ENABLE_CODEC_SHORTCUT && input instanceof BindingDataAware) {
- return ((BindingDataAware) input).bindingData();
+ if (ENABLE_CODEC_SHORTCUT && input instanceof BindingLazyContainerNode) {
+ return ((BindingLazyContainerNode<?>) input).getDataObject();
}
final SchemaPath inputSchemaPath = rpcPath.createChild(inputQname);
return codec.fromNormalizedNodeRpcData(inputSchemaPath, (ContainerNode) input);
+++ /dev/null
-/*
- * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.mdsal.binding.dom.adapter;
-
-import org.opendaylight.yangtools.yang.binding.DataObject;
-
-/**
- * Migration trait for exposing the Binding data object.
- *
- * @author Robert Varga
- */
-@Deprecated
-public interface BindingDataAware {
-
- DataObject bindingData();
-}
* deprecated, as we want to move to actions in the long term.
*/
class LazySerializedContainerNode extends AbstractBindingLazyContainerNode<DataObject,
- BindingNormalizedNodeCodecRegistry> implements BindingDataAware {
+ BindingNormalizedNodeCodecRegistry> {
private LazySerializedContainerNode(final QName identifier, final DataObject binding,
final BindingNormalizedNodeCodecRegistry registry) {
return new WithContextRef(rpcName.getLastComponent(), data, contextRef, codec);
}
- @Override
- public final DataObject bindingData() {
- return getDataObject();
- }
-
@Override
protected final ContainerNode computeContainerNode(final BindingNormalizedNodeCodecRegistry context) {
return context.toNormalizedNodeRpcData(getDataObject());
assertEquals(lazySerializedContainerNode.getIdentifier().getNodeType(),
lazySerializedContainerNode.getNodeType());
assertEquals(rpcName.getLastComponent(), lazySerializedContainerNode.getIdentifier().getNodeType());
- assertEquals(dataObject, lazySerializedContainerNode.bindingData());
+ assertEquals(dataObject, lazySerializedContainerNode.getDataObject());
}
}
\ No newline at end of file
package org.opendaylight.mdsal.binding.dom.codec.api;
import com.google.common.annotations.Beta;
-import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Delegator;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
* @author Robert Varga
*/
@Beta
-@NonNullByDefault
-public interface BindingLazyContainerNode<T> extends ContainerNode, Delegator<ContainerNode> {
+public interface BindingLazyContainerNode<T extends DataObject> extends ContainerNode, Delegator<ContainerNode> {
/**
* Returns the underlying DataObject.
*
* @return underlying DataObject.
*/
- T getDataObject();
+ @NonNull T getDataObject();
}