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.
Merge remote-tracking branch 'upstream/dev-2.x' into plan-connection-…
…defaults
- Loading branch information
Showing
126 changed files
with
2,107 additions
and
457 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
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
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
21 changes: 21 additions & 0 deletions
21
...c/main/java/org/opentripplanner/apis/gtfs/datafetchers/CallScheduledTimeTypeResolver.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.apis.gtfs.datafetchers; | ||
|
||
import graphql.TypeResolutionEnvironment; | ||
import graphql.schema.GraphQLObjectType; | ||
import graphql.schema.GraphQLSchema; | ||
import graphql.schema.TypeResolver; | ||
import org.opentripplanner.apis.gtfs.model.ArrivalDepartureTime; | ||
|
||
public class CallScheduledTimeTypeResolver implements TypeResolver { | ||
|
||
@Override | ||
public GraphQLObjectType getType(TypeResolutionEnvironment environment) { | ||
Object o = environment.getObject(); | ||
GraphQLSchema schema = environment.getSchema(); | ||
|
||
if (o instanceof ArrivalDepartureTime) { | ||
return schema.getObjectType("ArrivalDepartureTime"); | ||
} | ||
return null; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...rc/main/java/org/opentripplanner/apis/gtfs/datafetchers/CallStopLocationTypeResolver.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.apis.gtfs.datafetchers; | ||
|
||
import graphql.TypeResolutionEnvironment; | ||
import graphql.schema.GraphQLObjectType; | ||
import graphql.schema.GraphQLSchema; | ||
import graphql.schema.TypeResolver; | ||
import org.opentripplanner.transit.model.site.StopLocation; | ||
|
||
public class CallStopLocationTypeResolver implements TypeResolver { | ||
|
||
@Override | ||
public GraphQLObjectType getType(TypeResolutionEnvironment environment) { | ||
Object o = environment.getObject(); | ||
GraphQLSchema schema = environment.getSchema(); | ||
|
||
if (o instanceof StopLocation) { | ||
return schema.getObjectType("Stop"); | ||
} | ||
return null; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/EstimatedTimeImpl.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,25 @@ | ||
package org.opentripplanner.apis.gtfs.datafetchers; | ||
|
||
import graphql.schema.DataFetcher; | ||
import graphql.schema.DataFetchingEnvironment; | ||
import java.time.Duration; | ||
import java.time.OffsetDateTime; | ||
import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers; | ||
import org.opentripplanner.transit.model.timetable.EstimatedTime; | ||
|
||
public class EstimatedTimeImpl implements GraphQLDataFetchers.GraphQLEstimatedTime { | ||
|
||
@Override | ||
public DataFetcher<Duration> delay() { | ||
return environment -> getSource(environment).delay(); | ||
} | ||
|
||
@Override | ||
public DataFetcher<OffsetDateTime> time() { | ||
return environment -> getSource(environment).time().toOffsetDateTime(); | ||
} | ||
|
||
private EstimatedTime getSource(DataFetchingEnvironment environment) { | ||
return environment.getSource(); | ||
} | ||
} |
Oops, something went wrong.