AgencyAndId mappedServiceId = serviceIdMapping.get(trip.getServiceId()); if (mappedServiceId != null) { trip.setServiceId(mappedServiceId);
List<Trip> tripsForKey = tripsByKey.get(tripKey); Trip tripToKeep = tripsForKey.get(0); tripToKeep.setServiceId(updatedServiceId); for (int i = 1; i < tripsForKey.size(); i++) { Trip trip = tripsForKey.get(i);
/** * Replaces all references to the specified old service_id with the new * service_id for all {@link ServiceCalendar}, {@link ServiceCalendarDate}, * and {@link Trip} entities in the source feed. */ @Override protected void renameKey(GtfsMergeContext context, AgencyAndId oldId, AgencyAndId newId) { GtfsRelationalDao source = context.getSource(); ServiceCalendar calendar = source.getCalendarForServiceId(oldId); if (calendar != null) { calendar.setServiceId(newId); } for (ServiceCalendarDate calendarDate : source.getCalendarDatesForServiceId(oldId)) { calendarDate.setServiceId(newId); } for (Trip trip : source.getTripsForServiceId(oldId)) { trip.setServiceId(newId); } }
/** * Replaces all references to the specified old service_id with the new * service_id for all {@link ServiceCalendar}, {@link ServiceCalendarDate}, * and {@link Trip} entities in the source feed. */ @Override protected void renameKey(GtfsMergeContext context, AgencyAndId oldId, AgencyAndId newId) { GtfsRelationalDao source = context.getSource(); ServiceCalendar calendar = source.getCalendarForServiceId(oldId); if (calendar != null) { calendar.setServiceId(newId); } for (ServiceCalendarDate calendarDate : source.getCalendarDatesForServiceId(oldId)) { calendarDate.setServiceId(newId); } for (Trip trip : source.getTripsForServiceId(oldId)) { trip.setServiceId(newId); } }
sdonAtisTrip.setServiceId(newServiceId); sdonAtisTrip.setServiceId(newServiceId);
for (Trip trip : dts.getTrips()) { trip.setServiceId(newServiceId);
@Override public void run(TransformContext context, GtfsMutableRelationalDao dao, Object entity) { AgencyAndId oldServiceId = context.resolveId(ServiceIdKey.class, _oldServiceId); AgencyAndId newServiceId = context.resolveId(ServiceIdKey.class, _newServiceId); ServiceCalendar calendar = dao.getCalendarForServiceId(oldServiceId); if (calendar != null) { calendar.setServiceId(newServiceId); } for (ServiceCalendarDate calendarDate : dao.getCalendarDatesForServiceId(oldServiceId)) { calendarDate.setServiceId(newServiceId); } for (Trip trip : dao.getTripsForServiceId(oldServiceId)) { trip.setServiceId(newServiceId); } } }
trip.getServiceId(), -dayShift); shiftedIds.add(shifted); trip.setServiceId(shifted.getShiftedServiceId());