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; }
private void filterNonRevenueStopGroupingBeans( String agencyId, List<StopGroupingBean> groupings) { for (StopGroupingBean grouping : groupings) filterNonRevenueStopGroups(agencyId, grouping.getStopGroups()); }