use of org.openlca.ilcd.flows.Modelling in project olca-modules by GreenDelta.
the class FlowExtensions method getMethodExtension.
private static Other getMethodExtension(Flow flow, boolean create) {
Modelling mav = flow.modelling;
if (mav == null) {
if (!create)
return null;
mav = new Modelling();
flow.modelling = mav;
}
LCIMethod method = mav.lciMethod;
if (method == null) {
if (!create)
return null;
method = new LCIMethod();
mav.lciMethod = method;
}
Other other = method.other;
if (other == null && create) {
other = new Other();
method.other = other;
}
return other;
}
use of org.openlca.ilcd.flows.Modelling in project olca-modules by GreenDelta.
the class FlowExport method makeModellingInfo.
private Modelling makeModellingInfo() {
Modelling mav = new Modelling();
LCIMethod method = new LCIMethod();
mav.lciMethod = method;
method.flowType = getFlowType();
return mav;
}
use of org.openlca.ilcd.flows.Modelling in project olca-modules by GreenDelta.
the class FlowUpdateTest method makeFlow.
private Flow makeFlow(String id) {
Flow flow = new Flow();
FlowInfo info = new FlowInfo();
flow.flowInfo = info;
DataSetInfo dataInfo = new DataSetInfo();
dataInfo.uuid = id;
info.dataSetInfo = dataInfo;
FlowName name = new FlowName();
dataInfo.name = name;
LangString.set(name.baseName, "test flow - " + id, "en");
AdminInfo adminInfo = new AdminInfo();
Publication pub = new Publication();
adminInfo.publication = pub;
pub.version = "01.00.000";
flow.adminInfo = adminInfo;
Modelling mav = new Modelling();
flow.modelling = mav;
LCIMethod method = new LCIMethod();
mav.lciMethod = method;
method.flowType = FlowType.ELEMENTARY_FLOW;
return flow;
}
use of org.openlca.ilcd.flows.Modelling in project olca-modules by GreenDelta.
the class NetworkPutFlowTest method testPutFlow.
@Test
public void testPutFlow() throws Exception {
Assume.assumeTrue(TestServer.isAvailable());
String id = UUID.randomUUID().toString();
Flow flow = new Flow();
FlowInfo info = new FlowInfo();
flow.flowInfo = info;
info.dataSetInfo = makeDataInfo(id);
flow.adminInfo = makeAdminInfo();
Modelling mav = new Modelling();
flow.modelling = mav;
LCIMethod method = new LCIMethod();
mav.lciMethod = method;
method.flowType = FlowType.ELEMENTARY_FLOW;
client.put(flow);
}
Aggregations