Search in sources :

Example 1 with AbstractEnumerationBuilder

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();
}
Also used : AbstractEnumerationBuilder(org.opendaylight.mdsal.binding.model.ri.generated.type.builder.AbstractEnumerationBuilder) NonNull(org.eclipse.jdt.annotation.NonNull)

Aggregations

NonNull (org.eclipse.jdt.annotation.NonNull)1 AbstractEnumerationBuilder (org.opendaylight.mdsal.binding.model.ri.generated.type.builder.AbstractEnumerationBuilder)1