use of org.eclipse.vorto.core.api.model.BuilderUtils.EntityBuilder in project vorto by eclipse.
the class ModelContentToEcoreConverter method convertEntity.
private Entity convertEntity(EntityModel entity, ModelContent context) {
EntityBuilder builder = BuilderUtils.newEntity(new ModelId(ModelType.Datatype, entity.getId().getName(), entity.getId().getNamespace(), entity.getId().getVersion()));
builder.withCategory(entity.getCategory());
builder.withDescription(entity.getDescription());
builder.withDisplayName(entity.getDisplayName());
builder.withVortolang(entity.getVortolang());
builder.withReferences(entity.getReferences().stream().map(r -> new ModelId(ModelType.Datatype, r.getName(), r.getNamespace(), r.getVersion())).collect(Collectors.toList()));
for (ModelProperty sourceProperty : entity.getProperties()) {
Property property = createProperty(sourceProperty, builder, context);
builder.withProperty(property);
}
return builder.build();
}
Aggregations