if (tripDescriptor.hasScheduleRelationship() && tripDescriptor.getScheduleRelationship() == TripDescriptor.ScheduleRelationship.CANCELED) { newTimes.cancel();
blockDescriptor.setBlockInstance(instance); blockDescriptor.setStartDate(serviceDate); if (trip.hasScheduleRelationship()) { blockDescriptor.setScheduleRelationshipValue(trip.getScheduleRelationship().toString());
if (!(!tripUpdate.getTrip().hasScheduleRelationship() || tripUpdate.getTrip().getScheduleRelationship().equals(GtfsRealtime.TripDescriptor.ScheduleRelationship.UNSCHEDULED))) { if (!(!vehiclePosition.getTrip().hasScheduleRelationship() || vehiclePosition.getTrip().getScheduleRelationship().equals(GtfsRealtime.TripDescriptor.ScheduleRelationship.UNSCHEDULED))) {
onChanged(); if (other.hasScheduleRelationship()) { setScheduleRelationship(other.getScheduleRelationship());
/** * Checks E041 "trip doesn't have any stop_time_updates", and adds any errors to the provided error list. * * @param entity entity that the trip_update is from * @param tripUpdate the trip_update to examine * @param errors the list to add the errors to */ private void checkE041(GtfsRealtime.FeedEntity entity, GtfsRealtime.TripUpdate tripUpdate, List<OccurrenceModel> errors) { if (tripUpdate.getStopTimeUpdateCount() < 1) { if (tripUpdate.hasTrip() && tripUpdate.getTrip().hasScheduleRelationship() && tripUpdate.getTrip().getScheduleRelationship().equals(GtfsRealtime.TripDescriptor.ScheduleRelationship.CANCELED)) { // No errors - the trip was canceled, so it doesn't need any stop_time_updates - return return; } RuleUtils.addOccurrence(ValidationRules.E041, GtfsUtils.getTripId(entity, tripUpdate), errors, _log); } }
/** * Returns true if this tripDescriptor has a schedule_relationship of ADDED, false if it does not * * @param tripDescriptor TripDescriptor to examine * @return true if this tripDescriptor has a schedule_relationship of ADDED, false if it does not */ public static boolean isAddedTrip(GtfsRealtime.TripDescriptor tripDescriptor) { return tripDescriptor.hasScheduleRelationship() && tripDescriptor.getScheduleRelationship() == GtfsRealtime.TripDescriptor.ScheduleRelationship.ADDED; }
/** * Checks rule W009 - "schedule_relationship not populated", and adds any warnings that are found to the provided warning list * * @param entity entity which contains the specified trip * @param tripDescriptor trip to examine to see if it has a schedule_relationship * @param warnings list to add any warnings for W009 to */ private void checkW009(GtfsRealtime.FeedEntity entity, GtfsRealtime.TripDescriptor tripDescriptor, List<OccurrenceModel> warnings) { if (tripDescriptor != null && !tripDescriptor.hasScheduleRelationship()) { RuleUtils.addOccurrence(W009, GtfsUtils.getTripId(entity, tripDescriptor), warnings, _log); } }
if (tripUpdate.hasTrip() && tripUpdate.getTrip().hasScheduleRelationship()) { tripScheduleRelationship = tripUpdate.getTrip().getScheduleRelationship();
onChanged(); if (other.hasScheduleRelationship()) { setScheduleRelationship(other.getScheduleRelationship());