Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / sal / core / spi / data / SnapshotBackedReadTransaction.java
index eaf3aa7913a5dd03f1f29684471311498b2c0c72..bb402f8037752b661e095958b9e396dadf615f8e 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.sal.core.spi.data;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 import com.google.common.annotations.Beta;
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
@@ -30,7 +29,10 @@ import org.slf4j.LoggerFactory;
  * which delegates most of its calls to similar methods provided by underlying snapshot.
  *
  * @param <T> identifier type
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.dom.spi.store.SnapshotBackedReadTransaction} instead.
  */
+@Deprecated(forRemoval = true)
 @Beta
 public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTransaction<T>
         implements DOMStoreReadTransaction {
@@ -55,7 +57,7 @@ public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTran
     SnapshotBackedReadTransaction(final T identifier, final boolean debug, final DataTreeSnapshot snapshot,
             final TransactionClosePrototype<T> closeImpl) {
         super(identifier, debug);
-        this.stableSnapshot = Preconditions.checkNotNull(snapshot);
+        this.stableSnapshot = requireNonNull(snapshot);
         this.closeImpl = closeImpl;
         LOG.debug("ReadOnly Tx: {} allocated with snapshot {}", identifier, snapshot);
     }
@@ -79,7 +81,7 @@ public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTran
     @SuppressWarnings("checkstyle:IllegalCatch")
     public CheckedFuture<Optional<NormalizedNode<?,?>>, ReadFailedException> read(final YangInstanceIdentifier path) {
         LOG.debug("Tx: {} Read: {}", getIdentifier(), path);
-        checkNotNull(path, "Path must not be null.");
+        requireNonNull(path, "Path must not be null.");
 
         final DataTreeSnapshot snapshot = stableSnapshot;
         if (snapshot == null) {
@@ -97,7 +99,7 @@ public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTran
     @Override
     public CheckedFuture<Boolean, ReadFailedException> exists(final YangInstanceIdentifier path) {
         LOG.debug("Tx: {} Exists: {}", getIdentifier(), path);
-        checkNotNull(path, "Path must not be null.");
+        requireNonNull(path, "Path must not be null.");
 
         try {
             return Futures.immediateCheckedFuture(read(path).checkedGet().isPresent());