Proxy MD-SAL interfaces in DOMMountPointServiceImpl
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / LogicalDatastoreType.java
index 651c9194571f74e2512248ce7c2120199d1e1867..ed99552bbb465fdff4e629fcd28d7242ea3ead77 100644 (file)
@@ -48,4 +48,21 @@ public enum LogicalDatastoreType {
      * @return MD-SAL counterpart of this type.
      */
     public abstract org.opendaylight.mdsal.common.api.LogicalDatastoreType toMdsal();
+
+    /**
+     * Convert MD-SAL logical datastore type to this counterpart.
+     *
+     * @param type MD-SAL counterpart of this type.
+     * @return Corresponding value in this type.
+     */
+    public static LogicalDatastoreType fromMdsal(final org.opendaylight.mdsal.common.api.LogicalDatastoreType type) {
+        switch (type) {
+            case CONFIGURATION:
+                return CONFIGURATION;
+            case OPERATIONAL:
+                return OPERATIONAL;
+            default:
+                throw new IllegalArgumentException("Unhandled type " + type);
+        }
+    }
 }