use of org.onebusaway.enterprise.webapp.actions.m.model.StopResult in project onebusaway-application-modules by camsys.
the class IndexAction method getUniqueServiceAlertsForResults.
public Set<String> getUniqueServiceAlertsForResults() {
Set<String> uniqueServiceAlerts = new HashSet<String>();
for (SearchResult _result : _results.getMatches()) {
if (_results.getResultType().equals("RouteResult")) {
RouteResult result = (RouteResult) _result;
uniqueServiceAlerts.addAll(result.getServiceAlerts());
} else if (_results.getResultType().equals("StopResult")) {
StopResult result = (StopResult) _result;
for (RouteAtStop route : result.getAllRoutesAvailable()) {
uniqueServiceAlerts.addAll(route.getServiceAlerts());
}
}
}
return uniqueServiceAlerts;
}
use of org.onebusaway.enterprise.webapp.actions.m.model.StopResult in project onebusaway-application-modules by camsys.
the class SearchResultFactoryImplTest method testGetStopResultServiceAlertWithSummariesOnly.
@Test
public void testGetStopResultServiceAlertWithSummariesOnly() {
StopResult result = runGetStopResult(createServiceAlerts(new String[] {}, new String[] { TEST_SUMMARY }));
assertEquals(1, result.getAllRoutesAvailable().size());
Set<String> alerts = result.getAllRoutesAvailable().get(0).getServiceAlerts();
assertEquals(1, alerts.size());
assertEquals(TEST_SUMMARY, alerts.toArray()[0]);
assertEquals("name not expected", TEST_STOP_ID, result.getId());
}
Aggregations