- private final YangInstanceIdentifier rootIdentifier;
- private final LogicalDatastoreType datastoreType;
+ private final @NonNull YangInstanceIdentifier rootIdentifier;
+ private final @NonNull LogicalDatastoreType datastoreType;
+
+ public DOMDataTreeIdentifier(final LogicalDatastoreType datastoreType,
+ final YangInstanceIdentifier rootIdentifier) {
+ this.datastoreType = requireNonNull(datastoreType);
+ this.rootIdentifier = requireNonNull(rootIdentifier);
+ }
+
+ /**
+ * Return a counterpart to an MD-SAL data tree identifier.
+ *
+ * @return Controller data tree identifier.
+ */
+ public static DOMDataTreeIdentifier fromMdsal(final org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier mdsal) {
+ return new DOMDataTreeIdentifier(LogicalDatastoreType.fromMdsal(mdsal.getDatastoreType()),
+ mdsal.getRootIdentifier());
+ }