Skip to content

Commit

Permalink
renamed validator and notice
Browse files Browse the repository at this point in the history
  • Loading branch information
qcdyx committed Jan 13, 2025
1 parent 8aef7ad commit 49733ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* `stop_times.start_pickup_drop_off_window` or `stop_times.end_pickup_drop_off_window` are not
* defined for any trip of this route.
*
* <p>Generated notice: {@link RouteContinuousPickupDropOffNotice}.
* <p>Generated notice: {@link ContinuousPickupDropOffNotice}.
*/
@GtfsValidator
public class RouteContinuousPickupDropOffValidator extends FileValidator {
public class ContinuousPickupDropOffValidator extends FileValidator {
private final GtfsRouteTableContainer routeTable;
private final GtfsTripTableContainer tripTable;
private final GtfsStopTimeTableContainer stopTimeTable;

@Inject
public RouteContinuousPickupDropOffValidator(
public ContinuousPickupDropOffValidator(
GtfsRouteTableContainer routeTable,
GtfsTripTableContainer tripTable,
GtfsStopTimeTableContainer stopTimeTable) {
Expand All @@ -48,7 +48,7 @@ public void validate(NoticeContainer noticeContainer) {
for (GtfsStopTime stopTime : stopTimeTable.byTripId(trip.tripId())) {
if (stopTime.hasStartPickupDropOffWindow() || stopTime.hasEndPickupDropOffWindow()) {
noticeContainer.addValidationNotice(
new RouteContinuousPickupDropOffNotice(
new ContinuousPickupDropOffNotice(
route.csvRowNumber(),
trip.tripId(),
stopTime.startPickupDropOffWindow(),
Expand All @@ -60,12 +60,12 @@ public void validate(NoticeContainer noticeContainer) {
}

/**
* Notice generated when `routes.continuous_pickup` or `routes.continuous_drop_off` are included
* and `stop_times.start_pickup_drop_off_window` or `stop_times.end_pickup_drop_off_window` are
* defined for any trip of this route.
* Continuous pickup or drop-off are forbidden when routes.continuous_pickup or
* routes.continuous_drop_off are 2 or 3 and stop_times.start_pickup_drop_off_window or
* stop_times.end_pickup_drop_off_window are defined for any trip of this route.
*/
@GtfsValidationNotice(severity = ERROR)
public static class RouteContinuousPickupDropOffNotice extends ValidationNotice {
public static class ContinuousPickupDropOffNotice extends ValidationNotice {
/** The row number of the route in the CSV file. */
private final int routeCsvRowNumber;

Expand All @@ -78,7 +78,7 @@ public static class RouteContinuousPickupDropOffNotice extends ValidationNotice
/** The end time of the pickup/drop-off window. */
private final GtfsTime endPickupDropOffWindow;

public RouteContinuousPickupDropOffNotice(
public ContinuousPickupDropOffNotice(
int routeCsvRowNumber,
String tripId,
GtfsTime startPickupDropOffWindow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private static List<ValidationNotice> generateNotices(
GtfsTripTableContainer tripTable = GtfsTripTableContainer.forEntities(trips, noticeContainer);
GtfsStopTimeTableContainer stopTimeTable =
GtfsStopTimeTableContainer.forEntities(stopTimes, noticeContainer);
new RouteContinuousPickupDropOffValidator(routeTable, tripTable, stopTimeTable)
new ContinuousPickupDropOffValidator(routeTable, tripTable, stopTimeTable)
.validate(noticeContainer);
return noticeContainer.getValidationNotices();
}
Expand Down Expand Up @@ -52,7 +52,7 @@ public void continuousPickupWithPickupDropOffWindowShouldGenerateNotice() {
.build()));
assertThat(notices)
.containsExactly(
new RouteContinuousPickupDropOffValidator.RouteContinuousPickupDropOffNotice(
new ContinuousPickupDropOffValidator.ContinuousPickupDropOffNotice(
1, "trip1", GtfsTime.fromString("08:00:00"), GtfsTime.fromString("09:00:00")));
}

Expand Down Expand Up @@ -81,7 +81,7 @@ public void continuousDropOffWithPickupDropOffWindowShouldGenerateNotice() {
.build()));
assertThat(notices)
.containsExactly(
new RouteContinuousPickupDropOffValidator.RouteContinuousPickupDropOffNotice(
new ContinuousPickupDropOffValidator.ContinuousPickupDropOffNotice(
1, "trip1", GtfsTime.fromString("08:00:00"), GtfsTime.fromString("09:00:00")));
}

Expand Down

0 comments on commit 49733ac

Please sign in to comment.