package org.opendaylight.mdsal.binding.api;
import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.MoreExecutors;
import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
* @throws IllegalArgumentException if the path is {@link InstanceIdentifier#isWildcarded()} and the implementation
* does not support evaluating wildcards.
*/
- default @NonNull FluentFuture<Boolean> exists(final @NonNull LogicalDatastoreType store,
- final @NonNull InstanceIdentifier<?> path) {
- return read(store, path).transform(Optional::isPresent, MoreExecutors.directExecutor());
- }
+ @NonNull FluentFuture<Boolean> exists(@NonNull LogicalDatastoreType store, @NonNull InstanceIdentifier<?> path);
}
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;
<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);
}