Remove AsyncDataBroker and related classes
[mdsal.git] / dom / mdsal-dom-broker / src / main / java / org / opendaylight / mdsal / dom / broker / AbstractDOMForwardedCompositeTransaction.java
index 747ef3f4bfe4f0a9d2d71e8206fd9fc88f053dfd..0a0b8c91a3645080e1f2f8f91cd751026306095b 100644 (file)
@@ -5,16 +5,15 @@
  * 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.dom.broker;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import java.util.Map;
-import org.opendaylight.mdsal.common.api.AsyncTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
  * Composite DOM Transaction backed by {@link DOMStoreTransaction}.
@@ -30,7 +29,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  *            Subtransaction type
  */
 abstract class AbstractDOMForwardedCompositeTransaction<K, T extends DOMStoreTransaction> implements
-        AsyncTransaction<YangInstanceIdentifier, NormalizedNode<?, ?>> {
+        DOMDataTreeTransaction {
 
     private final Map<K, T> backingTxs;
     private final Object identifier;
@@ -44,8 +43,8 @@ abstract class AbstractDOMForwardedCompositeTransaction<K, T extends DOMStoreTra
      *            Key,value map of backing transactions.
      */
     protected AbstractDOMForwardedCompositeTransaction(final Object identifier, final Map<K, T> backingTxs) {
-        this.identifier = Preconditions.checkNotNull(identifier, "Identifier should not be null");
-        this.backingTxs = Preconditions.checkNotNull(backingTxs, "Backing transactions should not be null");
+        this.identifier = requireNonNull(identifier, "Identifier should not be null");
+        this.backingTxs = requireNonNull(backingTxs, "Backing transactions should not be null");
     }
 
     /**
@@ -59,10 +58,10 @@ abstract class AbstractDOMForwardedCompositeTransaction<K, T extends DOMStoreTra
      *             if no subtransaction is associated with key.
      */
     protected final T getSubtransaction(final K key) {
-        Preconditions.checkNotNull(key, "key must not be null.");
+        requireNonNull(key, "key must not be null.");
 
         final T ret = backingTxs.get(key);
-        Preconditions.checkArgument(ret != null, "No subtransaction associated with %s", key);
+        checkArgument(ret != null, "No subtransaction associated with %s", key);
         return ret;
     }