summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
ca8ea99)
Generated enumerations capture their YANG-declared name and expose
it as their method.
JIRA: MDSAL-392
Change-Id: Iac16b6b3599565f059332ed079c432c0603ac500
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.yang.binding.Action;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.yang.binding.Action;
import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.binding.Enumeration;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
import org.opendaylight.yangtools.yang.model.api.ActionDefinition;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
import org.opendaylight.yangtools.yang.model.api.ActionDefinition;
*
* @param enumClass enum generated class
* @return mapped enum constants from yang with their corresponding values in generated binding classes
*
* @param enumClass enum generated class
* @return mapped enum constants from yang with their corresponding values in generated binding classes
+ * @deprecated This method is not guaranteed to be accurate. Use {@link Enumeration#getName()} instead.
public BiMap<String, String> getEnumMapping(final Class<?> enumClass) {
final Entry<GeneratedType, WithStatus> typeWithSchema = getTypeWithSchema(enumClass);
return getEnumMapping(typeWithSchema);
public BiMap<String, String> getEnumMapping(final Class<?> enumClass) {
final Entry<GeneratedType, WithStatus> typeWithSchema = getTypeWithSchema(enumClass);
return getEnumMapping(typeWithSchema);
*
* @param enumClassName enum generated class name
* @return mapped enum constants from yang with their corresponding values in generated binding classes
*
* @param enumClassName enum generated class name
* @return mapped enum constants from yang with their corresponding values in generated binding classes
+ * @deprecated This method is not guaranteed to be accurate. Use {@link Enumeration#getName()} instead.
public BiMap<String, String> getEnumMapping(final String enumClassName) {
return getEnumMapping(findTypeWithSchema(enumClassName));
}
public BiMap<String, String> getEnumMapping(final String enumClassName) {
return getEnumMapping(findTypeWithSchema(enumClassName));
}