*/
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;
/**
* 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);
}
/**
*
* @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;
}
}
return rootIdentifier.equals(other.rootIdentifier);
}
-}
\ No newline at end of file
+
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + "{datastoreType = " + datastoreType + ", rootIdentifier = "
+ + rootIdentifier + "}";
+ }
+}