Search in sources :

Example 1 with EnumBuilder

use of org.eclipse.vorto.core.api.model.BuilderUtils.EnumBuilder in project vorto by eclipse.

the class ModelContentToEcoreConverter method convertEnum.

private org.eclipse.vorto.core.api.model.datatype.Enum convertEnum(EnumModel model) {
    EnumBuilder builder = BuilderUtils.newEnum(new ModelId(ModelType.Datatype, model.getId().getName(), model.getId().getNamespace(), model.getId().getVersion()));
    builder.withCategory(model.getCategory());
    builder.withDescription(model.getDescription());
    builder.withDisplayName(model.getDisplayName());
    builder.withVortolang(model.getVortolang());
    for (org.eclipse.vorto.model.EnumLiteral literal : model.getLiterals()) {
        builder.withLiteral(literal.getName(), literal.getDescription());
    }
    return builder.build();
}
Also used : Infomodel(org.eclipse.vorto.model.Infomodel) EnumBuilder(org.eclipse.vorto.core.api.model.BuilderUtils.EnumBuilder) ModelId(org.eclipse.vorto.core.api.model.model.ModelId)

Aggregations

EnumBuilder (org.eclipse.vorto.core.api.model.BuilderUtils.EnumBuilder)1 ModelId (org.eclipse.vorto.core.api.model.model.ModelId)1 Infomodel (org.eclipse.vorto.model.Infomodel)1