Search in sources :

Example 1 with StopProblemReportBean

use of org.onebusaway.transit_data.model.problems.StopProblemReportBean in project onebusaway-application-modules by camsys.

the class UserReportingServiceImpl method getRecordAsBean.

private StopProblemReportBean getRecordAsBean(StopProblemReportRecord record) {
    AgencyAndId stopId = record.getStopId();
    StopProblemReportBean bean = new StopProblemReportBean();
    bean.setCode(record.getCode());
    bean.setId(record.getId());
    bean.setStatus(record.getStatus());
    bean.setStopId(AgencyAndIdLibrary.convertToString(stopId));
    bean.setTime(record.getTime());
    bean.setUserComment(record.getUserComment());
    if (record.getUserLat() != null)
        bean.setUserLat(record.getUserLat());
    if (record.getUserLon() != null)
        bean.setUserLon(record.getUserLon());
    if (record.getUserLocationAccuracy() != null)
        bean.setUserLocationAccuracy(record.getUserLocationAccuracy());
    if (stopId != null) {
        try {
            bean.setStop(_stopBeanService.getStopForId(stopId));
        } catch (NoSuchStopServiceException ex) {
        }
    }
    return bean;
}
Also used : AgencyAndId(org.onebusaway.gtfs.model.AgencyAndId) StopProblemReportBean(org.onebusaway.transit_data.model.problems.StopProblemReportBean) NoSuchStopServiceException(org.onebusaway.exceptions.NoSuchStopServiceException)

Aggregations

NoSuchStopServiceException (org.onebusaway.exceptions.NoSuchStopServiceException)1 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)1 StopProblemReportBean (org.onebusaway.transit_data.model.problems.StopProblemReportBean)1