Skip to content

Commit

Permalink
Created getRouteTypes method and used ArrivalAndDepartureFilterByRout…
Browse files Browse the repository at this point in the history
…eType to get the filtered Routes.
  • Loading branch information
merhatsidk committed May 12, 2023
1 parent 915e2f3 commit a1e90ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public ArrivalAndDepartureFilterByRouteType(String routeTypeCommaDelimited) {

}

public List<Integer> getRouteTypes() {
return routeTypes;
}

public boolean matches(ArrivalAndDepartureBean bean) {
if (routeTypes == null || routeTypes.isEmpty())
return true; // no filter, everything matches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public final class ArrivalsAndDeparturesQueryBean implements Serializable {
private FilterChain systemFilterChain = new FilterChain();
private FilterChain instanceFilterChain = new FilterChain();

private List<Integer> routeTypes;
public ArrivalsAndDeparturesQueryBean() {

}
Expand Down Expand Up @@ -143,9 +144,16 @@ public void setRouteTypes(List<Integer> types) {
if (types == null || types.isEmpty()) return;
instanceFilterChain.add(new ArrivalAndDepartureFilterByRouteType(types));
}

public void setRouteType(String routeType) {
if (routeType == null) return;
instanceFilterChain.add(new ArrivalAndDepartureFilterByRouteType(routeType));
ArrivalAndDepartureFilterByRouteType arrivalAndDepartureFilterByRouteType = new ArrivalAndDepartureFilterByRouteType(routeType);
routeTypes = arrivalAndDepartureFilterByRouteType.getRouteTypes();
instanceFilterChain.add(arrivalAndDepartureFilterByRouteType);
}

public List<Integer> getRouteTypes(){
return routeTypes;
}

public void setAgenciesExcludingScheduled(HashSet<String> agencies){
Expand Down

0 comments on commit a1e90ed

Please sign in to comment.