use of uk.org.siri.siri.RoadSituationElementStructure.InfoLinks in project onebusaway-application-modules by camsys.
the class ServiceAlertsHelper method handleOtherFields.
private void handleOtherFields(ServiceAlertBean serviceAlert, PtSituationElementStructure ptSituation) {
if (serviceAlert == null) {
return;
}
if (serviceAlert.getUrls() != null && !serviceAlert.getUrls().isEmpty()) {
InfoLinks infoLinks = ptSituation.getInfoLinks();
if (infoLinks == null) {
infoLinks = new InfoLinks();
ptSituation.setInfoLinks(infoLinks);
}
for (NaturalLanguageStringBean linkBean : serviceAlert.getUrls()) {
InfoLinkStructure infoLinkStructure = new InfoLinkStructure();
infoLinkStructure.setUri(linkBean.getValue());
infoLinks.getInfoLink().add(infoLinkStructure);
}
}
if (serviceAlert.getPublicationWindows() == null) {
return;
}
// TODO Not handling severity yet.
ptSituation.setSeverity(SeverityEnumeration.UNDEFINED);
HalfOpenTimestampRangeStructure timestampRangeStructure = new HalfOpenTimestampRangeStructure();
if (serviceAlert.getPublicationWindows() != null && !serviceAlert.getPublicationWindows().isEmpty()) {
timestampRangeStructure.setStartTime(serviceAlertTimeToDate(serviceAlert.getPublicationWindows().get(0).getFrom()));
timestampRangeStructure.setEndTime(serviceAlertTimeToDate(serviceAlert.getPublicationWindows().get(0).getTo()));
ptSituation.setPublicationWindow(timestampRangeStructure);
}
}
Aggregations