use of org.opentripplanner.api.model.ApiStopTimesInPattern in project OpenTripPlanner by opentripplanner.
the class IndexAPI method getStoptimesForStopAndDate.
/**
* Return upcoming vehicle arrival/departure times at the given stop.
* @param date in YYYYMMDD or YYYY-MM-DD format
*/
@GET
@Path("/stops/{stopId}/stoptimes/{date}")
public List<ApiStopTimesInPattern> getStoptimesForStopAndDate(@PathParam("stopId") String stopId, @PathParam("date") String date, @QueryParam("omitNonPickups") boolean omitNonPickups) {
RoutingService routingService = createRoutingService();
Stop stop = getStop(routingService, stopId);
ServiceDate serviceDate = parseServiceDate("date", date);
List<StopTimesInPattern> stopTimes = routingService.getStopTimesForStop(stop, serviceDate, omitNonPickups);
return StopTimesInPatternMapper.mapToApi(stopTimes);
}
use of org.opentripplanner.api.model.ApiStopTimesInPattern in project OpenTripPlanner by opentripplanner.
the class StopTimesInPatternMapper method mapToApi.
public static ApiStopTimesInPattern mapToApi(StopTimesInPattern domain) {
if (domain == null) {
return null;
}
ApiStopTimesInPattern api = new ApiStopTimesInPattern();
api.pattern = TripPatternMapper.mapToApiShort(domain.pattern);
api.times = TripTimeMapper.mapToApi(domain.times);
return api;
}
Aggregations