forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c00ea1e
commit be93a97
Showing
8 changed files
with
58 additions
and
0 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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/org/opentripplanner/apis/gtfs/mapping/LegTypeMapper.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,22 @@ | ||
package org.opentripplanner.apis.gtfs.mapping; | ||
|
||
import javax.annotation.Nonnull; | ||
import org.opentripplanner.apis.gtfs.generated.GraphQLTypes; | ||
import org.opentripplanner.ext.flex.FlexibleTransitLeg; | ||
import org.opentripplanner.model.plan.Leg; | ||
import org.opentripplanner.model.plan.ScheduledTransitLeg; | ||
import org.opentripplanner.model.plan.StreetLeg; | ||
|
||
public class LegTypeMapper { | ||
|
||
|
||
@Nonnull | ||
public static GraphQLTypes.GraphQLLegType map(Leg source) { | ||
return switch (source) { | ||
case StreetLeg ignored -> GraphQLTypes.GraphQLLegType.STREET; | ||
case FlexibleTransitLeg ignored -> GraphQLTypes.GraphQLLegType.FLEX; | ||
case ScheduledTransitLeg ignored -> GraphQLTypes.GraphQLLegType.SCHEDULED_TRANSIT; | ||
default -> throw new IllegalStateException("Unhandled leg type: " + source); | ||
}; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
walkDistance | ||
walkTime | ||
legs { | ||
type | ||
mode | ||
start { | ||
scheduledTime | ||
|