use of org.opendaylight.mdsal.binding.model.ri.generated.type.builder.AbstractEnumerationBuilder in project mdsal by opendaylight.
the class AbstractTypeObjectGenerator method createEnumeration.
@NonNull
private static Enumeration createEnumeration(final TypeBuilderFactory builderFactory, final JavaTypeName typeName, final ModuleGenerator module, final EnumTypeDefinition typedef) {
// TODO units for typedef enum
final AbstractEnumerationBuilder builder = builderFactory.newEnumerationBuilder(typeName);
typedef.getDescription().map(BindingGeneratorUtil::encodeAngleBrackets).ifPresent(builder::setDescription);
typedef.getReference().ifPresent(builder::setReference);
builder.setModuleName(module.statement().argument().getLocalName());
builder.updateEnumPairsFromEnumTypeDef(typedef);
return builder.toInstance();
}
Aggregations