diff options
author | Smokowski, Kevin (ks6305) <ks6305@att.com> | 2018-07-24 21:08:01 +0000 |
---|---|---|
committer | Kevin Smokowski <ks6305@att.com> | 2018-07-25 13:28:54 +0000 |
commit | 3c74f62d1b4892560554e52e709e87769bd26ba0 (patch) | |
tree | 822b1ccc7bc8d948fd8dc473c2b6c796d1f2ba86 /sli/provider/src/test/java/org/opendaylight | |
parent | cfabda23cb6dc6c98e3266228f3bd2f409591a2f (diff) |
support legacy enumeration mapping
support legacy enumeration mapping in MdsalHelper
Change-Id: I637f5dc368da75e24fb8cc3ebdebd002aae3f025
Issue-ID: CCSDK-396
Signed-off-by: Smokowski, Kevin (ks6305) <ks6305@att.com>
Diffstat (limited to 'sli/provider/src/test/java/org/opendaylight')
-rw-r--r-- | sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/CosModelType.java | 51 | ||||
-rw-r--r-- | sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/WrapperObj.java | 10 |
2 files changed, 61 insertions, 0 deletions
diff --git a/sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/CosModelType.java b/sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/CosModelType.java new file mode 100644 index 00000000..2aaaf8aa --- /dev/null +++ b/sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/CosModelType.java @@ -0,0 +1,51 @@ +package org.opendaylight.yang.gen.v1.test; + +public enum CosModelType { + _4COS(0, "4COS"), + + _6COS(1, "6COS") + ; + + private static final java.util.Map<java.lang.Integer, CosModelType> VALUE_MAP; + + static { + final com.google.common.collect.ImmutableMap.Builder<java.lang.Integer, CosModelType> b = com.google.common.collect.ImmutableMap.builder(); + for (CosModelType enumItem : CosModelType.values()) { + b.put(enumItem.value, enumItem); + } + + VALUE_MAP = b.build(); + } + + private final java.lang.String name; + private final int value; + + private CosModelType(int value, java.lang.String name) { + this.value = value; + this.name = name; + } + + /** + * Returns the name of the enumeration item as it is specified in the input yang. + * + * @return the name of the enumeration item as it is specified in the input yang + */ + public java.lang.String getName() { + return name; + } + + /** + * @return integer value + */ + public int getIntValue() { + return value; + } + + /** + * @param valueArg integer value + * @return corresponding CosModelType item + */ + public static CosModelType forValue(int valueArg) { + return VALUE_MAP.get(valueArg); + } +}
\ No newline at end of file diff --git a/sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/WrapperObj.java b/sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/WrapperObj.java new file mode 100644 index 00000000..bae0bdb1 --- /dev/null +++ b/sli/provider/src/test/java/org/opendaylight/yang/gen/v1/test/WrapperObj.java @@ -0,0 +1,10 @@ +package org.opendaylight.yang.gen.v1.test; + +public class WrapperObj { + + CosModelType cosModel = CosModelType._4COS; + + public CosModelType getCosModelType() { + return cosModel; + } +} |