
org.opentripplanner.apis.transmodel.mapping.ViaRequestMapper 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.transmodel.mapping;
import graphql.schema.DataFetchingEnvironment;
import java.time.Instant;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.opentripplanner.apis.transmodel.TransmodelRequestContext;
import org.opentripplanner.framework.graphql.GraphQLUtils;
import org.opentripplanner.routing.api.request.RouteRequest;
import org.opentripplanner.routing.api.request.RouteViaRequest;
import org.opentripplanner.routing.api.request.ViaLocation;
import org.opentripplanner.routing.api.request.request.JourneyRequest;
import org.opentripplanner.standalone.api.OtpServerRequestContext;
/**
* This class maps a GraphQL viaTrip query into a {@link RouteViaRequest}
*/
public class ViaRequestMapper {
/**
* Create a RouteViaRequest from the input fields of the viaTrip query arguments.
*/
public static RouteViaRequest createRouteViaRequest(DataFetchingEnvironment environment) {
TransmodelRequestContext context = environment.getContext();
OtpServerRequestContext serverContext = context.getServerContext();
RouteRequest request = serverContext.defaultRouteRequest();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy