Search in sources :

Example 1 with RouteV2Bean

use of org.onebusaway.api.model.transit.RouteV2Bean in project onebusaway-application-modules by camsys.

the class RoutesForAgencyAction method show.

public DefaultHttpHeaders show() {
    if (hasErrors())
        return setValidationErrorsResponse();
    if (!isVersion(V2))
        return setUnknownVersionResponse();
    ListBean<RouteBean> routes = _service.getRoutesForAgencyId(_id);
    BeanFactoryV2 factory = getBeanFactoryV2();
    List<RouteV2Bean> beans = new ArrayList<RouteV2Bean>();
    for (RouteBean route : routes.getList()) beans.add(factory.getRoute(route));
    return setOkResponse(factory.list(beans, false));
}
Also used : RouteBean(org.onebusaway.transit_data.model.RouteBean) ArrayList(java.util.ArrayList) RouteV2Bean(org.onebusaway.api.model.transit.RouteV2Bean) BeanFactoryV2(org.onebusaway.api.model.transit.BeanFactoryV2)

Aggregations

ArrayList (java.util.ArrayList)1 BeanFactoryV2 (org.onebusaway.api.model.transit.BeanFactoryV2)1 RouteV2Bean (org.onebusaway.api.model.transit.RouteV2Bean)1 RouteBean (org.onebusaway.transit_data.model.RouteBean)1