use of org.onebusaway.transit_data.model.problems.EProblemReportStatus in project onebusaway-application-modules by camsys.
the class UserReportingServiceImpl method getTripProblemReportSummaries.
@Override
public ListBean<TripProblemReportSummaryBean> getTripProblemReportSummaries(TripProblemReportQueryBean query, ETripProblemGroupBy groupBy) {
List<T2<Object, Integer>> records = _userReportingDao.getTripProblemReportSummaries(query, groupBy);
List<TripProblemReportSummaryBean> beans = new ArrayList<TripProblemReportSummaryBean>(records.size());
for (T2<Object, Integer> record : records) {
TripProblemReportSummaryBean bean = new TripProblemReportSummaryBean();
bean.setCount(record.getSecond());
switch(groupBy) {
case TRIP:
{
AgencyAndId tripId = (AgencyAndId) record.getFirst();
bean.setTrip(_tripBeanService.getTripForId(tripId));
break;
}
case STATUS:
{
EProblemReportStatus status = (EProblemReportStatus) record.getFirst();
bean.setStatus(status);
break;
}
case LABEL:
{
String label = (String) record.getFirst();
bean.setLabel(label);
break;
}
}
beans.add(bean);
}
return new ListBean<TripProblemReportSummaryBean>(beans, false);
}
Aggregations