Search in sources :

Example 1 with SituationSimpleRefStructure

use of uk.org.siri.siri_2.SituationSimpleRefStructure in project onebusaway-application-modules by camsys.

the class SiriSupportV2 method fillSituations.

private static void fillSituations(MonitoredVehicleJourneyStructure monitoredVehicleJourney, TripStatusBean tripStatus) {
    if (tripStatus == null || tripStatus.getSituations() == null || tripStatus.getSituations().isEmpty()) {
        return;
    }
    List<SituationRefStructure> situationRef = monitoredVehicleJourney.getSituationRef();
    for (ServiceAlertBean situation : tripStatus.getSituations()) {
        SituationRefStructure sitRef = new SituationRefStructure();
        SituationSimpleRefStructure sitSimpleRef = new SituationSimpleRefStructure();
        sitSimpleRef.setValue(situation.getId());
        sitRef.setSituationSimpleRef(sitSimpleRef);
        situationRef.add(sitRef);
    }
}
Also used : SituationRefStructure(uk.org.siri.siri_2.SituationRefStructure) ServiceAlertBean(org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean) SituationSimpleRefStructure(uk.org.siri.siri_2.SituationSimpleRefStructure)

Aggregations

ServiceAlertBean (org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean)1 SituationRefStructure (uk.org.siri.siri_2.SituationRefStructure)1 SituationSimpleRefStructure (uk.org.siri.siri_2.SituationSimpleRefStructure)1