forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Set of StreetModes to PathTransfer and other changes related to it.
- Loading branch information
1 parent
8951c60
commit 2215154
Showing
8 changed files
with
106 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...org/opentripplanner/routing/algorithm/mapping/StreetModeToTransferTraverseModeMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.opentripplanner.routing.algorithm.mapping; | ||
|
||
import org.opentripplanner.routing.api.request.StreetMode; | ||
import org.opentripplanner.street.search.TraverseMode; | ||
|
||
/** | ||
* Maps street mode to transfer traverse mode. | ||
*/ | ||
public class StreetModeToTransferTraverseModeMapper { | ||
|
||
public static TraverseMode map(StreetMode mode) { | ||
return switch (mode) { | ||
case WALK -> TraverseMode.WALK; | ||
case BIKE -> TraverseMode.BICYCLE; | ||
case CAR -> TraverseMode.CAR; | ||
default -> throw new IllegalArgumentException( | ||
String.format("StreetMode %s can not be mapped to a TraverseMode for transfers.", mode) | ||
); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters