Search in sources :

Example 1 with EnumModel

use of org.eclipse.vorto.repository.api.content.EnumModel in project vorto by eclipse.

the class ModelDtoFactory method createResource.

public static EnumModel createResource(Enum model) {
    EnumModel resource = new EnumModel(new ModelId(model.getName(), model.getNamespace(), model.getVersion()), ModelType.Datatype);
    resource.setDescription(model.getDescription());
    resource.setDisplayName(model.getDisplayname());
    resource.setReferences(model.getReferences().stream().map(reference -> createModelId(reference)).collect(Collectors.toList()));
    resource.setLiterals(model.getEnums().stream().map(p -> createLiteral(p)).collect(Collectors.toList()));
    return resource;
}
Also used : EnumModel(org.eclipse.vorto.repository.api.content.EnumModel) ModelId(org.eclipse.vorto.repository.api.ModelId)

Aggregations

ModelId (org.eclipse.vorto.repository.api.ModelId)1 EnumModel (org.eclipse.vorto.repository.api.content.EnumModel)1