Skip to content

Commit

Permalink
Addresses comments in code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
eibakke committed Dec 19, 2024
1 parent b6f389b commit 8bd6845
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class FindRegularStopsByBoundingBoxRequest {

private final boolean filterByInUse;

FindRegularStopsByBoundingBoxRequest(
FindRegularStopsByBoundingBoxRequest(
Envelope envelope,
@Nullable String feedId,
boolean filterByInUse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class FindRegularStopsByBoundingBoxRequestBuilder {

private boolean filterByInUse = false;

FindRegularStopsByBoundingBoxRequestBuilder(Envelope envelope) {
FindRegularStopsByBoundingBoxRequestBuilder(Envelope envelope) {
this.envelope = envelope;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TripOnServiceDateRequest {
private final FilterValues<String> netexInternalPlanningCodes;
private final FilterValues<TripAlteration> alterations;

protected TripOnServiceDateRequest(
TripOnServiceDateRequest(
RequiredFilterValues<LocalDate> serviceDates,
FilterValues<FeedScopedId> agencies,
FilterValues<FeedScopedId> routes,
Expand All @@ -41,7 +41,7 @@ protected TripOnServiceDateRequest(
this.alterations = alterations;
}

public static TripOnServiceDateRequestBuilder of(RequiredFilterValues serviceDates) {
public static TripOnServiceDateRequestBuilder of(RequiredFilterValues<LocalDate> serviceDates) {
return new TripOnServiceDateRequestBuilder(serviceDates);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class TripOnServiceDateRequestBuilder {
"alterations",
List.of()
);
private RequiredFilterValues<LocalDate> serviceDates;
private final RequiredFilterValues<LocalDate> serviceDates;

protected TripOnServiceDateRequestBuilder(RequiredFilterValues serviceDates) {
TripOnServiceDateRequestBuilder(RequiredFilterValues<LocalDate> serviceDates) {
this.serviceDates = serviceDates;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TripRequest {
private final FilterValues<String> netexInternalPlanningCodes;
private final FilterValues<LocalDate> serviceDates;

protected TripRequest(
TripRequest(
FilterValues<FeedScopedId> agencies,
FilterValues<FeedScopedId> routes,
FilterValues<String> netexInternalPlanningCodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TripRequestBuilder {
List.of()
);

protected TripRequestBuilder() {}
TripRequestBuilder() {}

public TripRequestBuilder withAgencies(FilterValues<FeedScopedId> agencies) {
this.agencies = agencies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class RegularStopMatcherFactory {

/**
* Creates a matcher that filters {@link RegularStop} objects with the provided {@code request}
* and {@link inUseProvider}. The {@link inUseProvider} is used to determine if a {@link RegularStop} is
* in use. Typically the inUseProvider is a function that checks if the {@link RegularStop} is in
* a set of used stops.
* and {@code inUseProvider}. The {@code inUseProvider} is used to determine if a {@link RegularStop} is
* in use. The inUseProvider is an injected function, because the check is done by the transit service
* which has access to all stops and routes. A stop is used if it has routes visiting the stop.
*/
public static Matcher<RegularStop> of(
FindRegularStopsByBoundingBoxRequest request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ List<TripTimeOnDate> findTripTimeOnDate(
* So, if more patterns of mode BUS than RAIL visit the group, the result will be [BUS,RAIL].
*/
List<TransitMode> findTransitModes(StopLocationsGroup station);

/**
* For a {@link StopLocation} return its modes.
* <p>
Expand All @@ -303,15 +304,12 @@ List<TripTimeOnDate> findTripTimeOnDate(
Map<LocalDate, TIntSet> getServiceCodesRunningForDate();

/**
* Returns a list of TripOnServiceDates that match the filtering defined in the request.
*
* @param request - A {@link TripOnServiceDateRequest} object with filtering defined.
* @return - A list of {@link TripOnServiceDate}s
* Returns a list of {@link TripOnServiceDate}s that match the filtering defined in the request.
*/
List<TripOnServiceDate> findTripsOnServiceDate(TripOnServiceDateRequest request);

/**
* Returns a list of Trips that match the filtering defined in the request.
* Returns a list of {@link Trip}s that match the filtering defined in the request.
*
*/
List<Trip> getTrips(TripRequest request);
Expand All @@ -325,8 +323,8 @@ List<TripTimeOnDate> findTripTimeOnDate(
boolean containsTrip(FeedScopedId id);

/**
* Returns a list of RegularStops that lay within a bounding box and match the other criteria in
* the request object.
* Returns a list of {@link RegularStop}s that lay within a bounding box and match the other criteria
* in the request object.
*/
Collection<RegularStop> findRegularStopsByBoundingBox(
FindRegularStopsByBoundingBoxRequest request
Expand Down

0 comments on commit 8bd6845

Please sign in to comment.