Force ReadOperations (and TypedReadTransaction) to be implemented
[mdsal.git] / binding / mdsal-binding-util / src / main / java / org / opendaylight / mdsal / binding / util / TypedReadTransaction.java
index 845923191f191b6ae0123f8d2acecbf7c58d35eb..25cb823fd3e2fff4fb965ee9d98d5094215d75f3 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.mdsal.binding.util;
 
 import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.MoreExecutors;
 import java.util.Optional;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.Transaction;
@@ -37,16 +36,12 @@ public interface TypedReadTransaction<D extends Datastore> extends Transaction {
     <T extends DataObject> FluentFuture<Optional<T>> read(InstanceIdentifier<T> path);
 
     /**
-     * Determines if an object exists at the given path. Default implementation just delegates to
-     * {@link #read(InstanceIdentifier)}. Implementations are recommended to override with a more efficient
-     * implementation.
+     * Determines if an object exists at the given path.
      *
      * @see ReadTransaction#exists(LogicalDatastoreType, InstanceIdentifier)
      *
      * @param path The path to read from.
      * @return A future providing access to the result of the check, when it’s available, or any error encountered.
      */
-    default FluentFuture<Boolean> exists(final InstanceIdentifier<?> path) {
-        return read(path).transform(Optional::isPresent, MoreExecutors.directExecutor());
-    }
+    FluentFuture<Boolean> exists(InstanceIdentifier<?> path);
 }