Search in sources :

Example 1 with ProtoFlowMap

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;
}
Also used : FlowMapEntry(org.openlca.io.maps.FlowMapEntry) ProtoFlowMapEntry(org.openlca.proto.ProtoFlowMapEntry) ProtoFlowMap(org.openlca.proto.ProtoFlowMap) FlowMap(org.openlca.io.maps.FlowMap)

Aggregations

FlowMap (org.openlca.io.maps.FlowMap)1 FlowMapEntry (org.openlca.io.maps.FlowMapEntry)1 ProtoFlowMap (org.openlca.proto.ProtoFlowMap)1 ProtoFlowMapEntry (org.openlca.proto.ProtoFlowMapEntry)1