X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FLogicalDatastoreType.java;h=b07e2ea57f41f1658e56e95170f9d56344fd756e;hb=refs%2Fchanges%2F63%2F82863%2F1;hp=d2e41f1688b78df1922724a02dbf662a262013dc;hpb=e27d63bdcfbfb0c1078a9c3e5aabf59ae7e2315f;p=controller.git diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/LogicalDatastoreType.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/LogicalDatastoreType.java index d2e41f1688..b07e2ea57f 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/LogicalDatastoreType.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/LogicalDatastoreType.java @@ -7,25 +7,63 @@ */ package org.opendaylight.controller.md.sal.common.api.data; -public enum LogicalDatastoreType { +import org.eclipse.jdt.annotation.NonNullByDefault; +@Deprecated +@NonNullByDefault +public enum LogicalDatastoreType { /** * Logical atastore representing operational state of the system * and it's components * + *

* This datastore is used to describe operational state of * the system and it's operation related data. * */ - OPERATIONAL, + OPERATIONAL { + @Override + public org.opendaylight.mdsal.common.api.LogicalDatastoreType toMdsal() { + return org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL; + } + }, /** * Logical Datastore representing configuration state of the system * and it's components. * + *

* This datastore is used to describe intended state of * the system and intended operation mode. * */ - CONFIGURATION + CONFIGURATION { + @Override + public org.opendaylight.mdsal.common.api.LogicalDatastoreType toMdsal() { + return org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION; + } + }; + /** + * Convert this logical datastore type to its MD-SAL counterpart. + * + * @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); + } + } }