use of org.openlca.proto.ProtoFlowMap in project olca-modules by GreenDelta.
the class FlowMapService method toModel.
private FlowMap toModel(ProtoFlowMap proto) {
if (proto == null)
return FlowMap.empty();
var flowMap = new FlowMap();
flowMap.name = proto.getName();
flowMap.description = proto.getDescription();
flowMap.refId = proto.getId();
for (var protoEntry : proto.getMappingsList()) {
var source = toModelRef(protoEntry.getFrom());
var target = toModelRef(protoEntry.getTo());
var factor = protoEntry.getConversionFactor();
flowMap.entries.add(new FlowMapEntry(source, target, factor));
}
return flowMap;
}
Aggregations