Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / md / sal / binding / api / DataTreeIdentifier.java
index b86d31b79082db4641126f90d9123eb9e8fb75c2..a387d30b27382d61fb3f5ebbb3e261cbe53a03fb 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.controller.md.sal.binding.api;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.io.Serializable;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.concepts.Path;
@@ -19,15 +20,20 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 /**
  * A unique identifier for a particular subtree. It is composed of the logical
  * data store type and the instance identifier of the root node.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.api.DataTreeIdentifier} instead.
  */
-public final class DataTreeIdentifier<T extends DataObject> implements Immutable, Path<DataTreeIdentifier<?>>, Serializable {
+@Deprecated
+public final class DataTreeIdentifier<T extends DataObject> implements Immutable,
+        Path<DataTreeIdentifier<?>>, Serializable {
     private static final long serialVersionUID = 1L;
-    private final InstanceIdentifier<T> rootIdentifier;
-    private final LogicalDatastoreType datastoreType;
+
+    private final @NonNull InstanceIdentifier<T> rootIdentifier;
+    private final @NonNull LogicalDatastoreType datastoreType;
 
     public DataTreeIdentifier(final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> rootIdentifier) {
-        this.datastoreType = Preconditions.checkNotNull(datastoreType);
-        this.rootIdentifier = Preconditions.checkNotNull(rootIdentifier);
+        this.datastoreType = requireNonNull(datastoreType);
+        this.rootIdentifier = requireNonNull(rootIdentifier);
     }
 
     /**
@@ -35,16 +41,16 @@ public final class DataTreeIdentifier<T extends DataObject> implements Immutable
      *
      * @return Logical data store type. Guaranteed to be non-null.
      */
-    public @Nonnull LogicalDatastoreType getDatastoreType() {
+    public @NonNull LogicalDatastoreType getDatastoreType() {
         return datastoreType;
     }
 
     /**
-     * Return the {@link YangInstanceIdentifier} of the root node.
+     * Return the {@link InstanceIdentifier} of the root node.
      *
      * @return Instance identifier corresponding to the root node.
      */
-    public @Nonnull InstanceIdentifier<T> getRootIdentifier() {
+    public @NonNull InstanceIdentifier<T> getRootIdentifier() {
         return rootIdentifier;
     }
 
@@ -76,4 +82,10 @@ public final class DataTreeIdentifier<T extends DataObject> implements Immutable
         }
         return rootIdentifier.equals(other.rootIdentifier);
     }
-}
\ No newline at end of file
+
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + "{datastoreType = " + datastoreType + ", rootIdentifier = "
+                + rootIdentifier + "}";
+    }
+}