@@ -32,15 +32,15 @@ public final class GtfsFaresV2Service implements Serializable {
32
32
private static final Logger LOG = LoggerFactory .getLogger (GtfsFaresV2Service .class );
33
33
private final List <FareLegRule > legRules ;
34
34
private final List <FareTransferRule > transferRules ;
35
- private final Multimap <FeedScopedId , String > stopAreas ;
35
+ private final Multimap <FeedScopedId , FeedScopedId > stopAreas ;
36
36
private final Set <FeedScopedId > networksWithRules ;
37
- private final Set <String > fromAreasWithRules ;
38
- private final Set <String > toAreasWithRules ;
37
+ private final Set <FeedScopedId > fromAreasWithRules ;
38
+ private final Set <FeedScopedId > toAreasWithRules ;
39
39
40
40
public GtfsFaresV2Service (
41
41
List <FareLegRule > legRules ,
42
42
List <FareTransferRule > fareTransferRules ,
43
- Multimap <FeedScopedId , String > stopAreas
43
+ Multimap <FeedScopedId , FeedScopedId > stopAreas
44
44
) {
45
45
this .legRules = legRules ;
46
46
this .transferRules = fareTransferRules ;
@@ -72,9 +72,9 @@ public ProductResult getProducts(Itinerary itinerary) {
72
72
return new ProductResult (coveringItinerary , allLegProducts );
73
73
}
74
74
75
- private static Set <String > findAreasWithRules (
75
+ private static Set <FeedScopedId > findAreasWithRules (
76
76
List <FareLegRule > legRules ,
77
- Function <FareLegRule , String > getArea
77
+ Function <FareLegRule , FeedScopedId > getArea
78
78
) {
79
79
return legRules .stream ().map (getArea ).filter (Objects ::nonNull ).collect (Collectors .toSet ());
80
80
}
@@ -207,7 +207,11 @@ private Optional<FareLegRule> getFareLegRuleByGroupId(FeedScopedId groupId) {
207
207
return legRules .stream ().filter (lr -> groupId .equals (lr .legGroupId ())).findAny ();
208
208
}
209
209
210
- private boolean matchesArea (StopLocation stop , String areaId , Set <String > areasWithRules ) {
210
+ private boolean matchesArea (
211
+ StopLocation stop ,
212
+ FeedScopedId areaId ,
213
+ Set <FeedScopedId > areasWithRules
214
+ ) {
211
215
var stopAreas = this .stopAreas .get (stop .getId ());
212
216
return (
213
217
(isNull (areaId ) && stopAreas .stream ().noneMatch (areasWithRules ::contains )) ||
0 commit comments