Skip to content

Commit

Permalink
Merge pull request #113 from camsys/Test-NYS-147
Browse files Browse the repository at this point in the history
Created getRouteTypes method and used ArrivalAndDepartureFilterByRout…
  • Loading branch information
sheldonabrown authored May 15, 2023
2 parents 915e2f3 + a1e90ed commit 6541bbb
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 6541bbb

Please sign in to comment.