
org.opentripplanner.apis.gtfs.model.StopPosition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
The newest version!
package org.opentripplanner.apis.gtfs.model;
import graphql.TypeResolutionEnvironment;
import graphql.schema.GraphQLObjectType;
import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers;
public interface StopPosition extends GraphQLDataFetchers.GraphQLStopPosition {
record PositionAtStop(int position) implements StopPosition {}
record PositionBetweenStops(int previousPosition, int nextPosition) implements StopPosition {}
@Override
default GraphQLObjectType getType(TypeResolutionEnvironment env) {
var schema = env.getSchema();
Object o = env.getObject();
if (o instanceof PositionAtStop) {
return schema.getObjectType("PositionAtStop");
}
if (o instanceof PositionBetweenStops) {
return schema.getObjectType("PositionBetweenStops");
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy