Пример #1
0
  public StopsForRouteV2Bean getStopsForRoute(
      StopsForRouteBean stopsForRoute, boolean includePolylines) {
    StopsForRouteV2Bean bean = new StopsForRouteV2Bean();

    RouteBean route = stopsForRoute.getRoute();
    if (route != null) {
      addToReferences(route);
      bean.setRouteId(route.getId());
    }

    List<String> stopIds = new ArrayList<String>();
    for (StopBean stop : stopsForRoute.getStops()) {
      stopIds.add(stop.getId());
      addToReferences(stop);
    }
    bean.setStopIds(stopIds);
    bean.setStopGroupings(stopsForRoute.getStopGroupings());
    if (!includePolylines) {
      for (StopGroupingBean grouping : stopsForRoute.getStopGroupings()) {
        for (StopGroupBean group : grouping.getStopGroups()) group.setPolylines(null);
      }
    }
    if (includePolylines) bean.setPolylines(stopsForRoute.getPolylines());
    return bean;
  }
Пример #2
0
 public void filterNonRevenueStops(StopsForRouteBean bean) {
   filterNonRevenueStopGroupingBeans(bean.getRoute().getAgency().getId(), bean.getStopGroupings());
   filterNonRevenueStops(bean.getStops());
 }