2 * Copyright © 2017, 2018 Red Hat, Inc. and others.
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.spi;
10 import com.google.common.collect.ForwardingObject;
11 import com.google.common.util.concurrent.FluentFuture;
12 import java.util.Optional;
13 import org.opendaylight.mdsal.binding.api.ReadTransaction;
14 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
15 import org.opendaylight.yangtools.yang.binding.DataObject;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 * Utility {@link ReadTransaction} implementation which forwards all interface method
20 * invocation to a delegate instance.
22 public class ForwardingReadTransaction extends ForwardingObject implements ReadTransaction {
24 private final ReadTransaction delegate;
26 protected ForwardingReadTransaction(ReadTransaction delegate) {
27 this.delegate = delegate;
31 protected ReadTransaction delegate() {
36 public <T extends DataObject> FluentFuture<Optional<T>> read(LogicalDatastoreType store,
37 InstanceIdentifier<T> path) {
38 return delegate.read(store, path);
42 public Object getIdentifier() {
43 return delegate.getIdentifier();