use of uk.org.siri.siri.PtConsequenceStructure in project onebusaway-application-modules by camsys.
the class ServiceAlertsHelper method handleConsequences.
private void handleConsequences(ServiceAlertBean serviceAlert, PtSituationElementStructure ptSituation) {
if (serviceAlert == null)
return;
List<SituationConsequenceBean> consequences = serviceAlert.getConsequences();
if (consequences == null || consequences.isEmpty())
return;
PtConsequencesStructure ptConsequences = new PtConsequencesStructure();
ptSituation.setConsequences(ptConsequences);
for (SituationConsequenceBean consequence : consequences) {
EEffect effect = consequence.getEffect();
PtConsequenceStructure ptConsequenceStructure = new PtConsequenceStructure();
ServiceConditionEnumeration serviceCondition = getEFfectAsCondition(effect);
ptConsequenceStructure.setCondition(serviceCondition);
String detourPath = consequence.getDetourPath();
if (!StringUtils.isBlank(detourPath)) {
ExtensionsStructure extensionStructure = new ExtensionsStructure();
OneBusAwayConsequence oneBusAwayConsequence = new OneBusAwayConsequence();
oneBusAwayConsequence.setDiversionPath(detourPath);
extensionStructure.setAny(oneBusAwayConsequence);
ptConsequenceStructure.setExtensions(extensionStructure);
}
ptConsequences.getConsequence().add(ptConsequenceStructure);
}
}
Aggregations