
org.opentripplanner.apis.gtfs.mapping.routerequest.WalkPreferencesMapper 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.mapping.routerequest;
import org.opentripplanner.apis.gtfs.generated.GraphQLTypes;
import org.opentripplanner.routing.api.request.preference.WalkPreferences;
public class WalkPreferencesMapper {
static void setWalkPreferences(
WalkPreferences.Builder preferences,
GraphQLTypes.GraphQLWalkPreferencesInput args
) {
if (args == null) {
return;
}
var speed = args.getGraphQLSpeed();
if (speed != null) {
preferences.withSpeed(speed);
}
var reluctance = args.getGraphQLReluctance();
if (reluctance != null) {
preferences.withReluctance(reluctance);
}
var walkSafetyFactor = args.getGraphQLSafetyFactor();
if (walkSafetyFactor != null) {
preferences.withSafetyFactor(walkSafetyFactor);
}
var boardCost = args.getGraphQLBoardCost();
if (boardCost != null) {
preferences.withBoardCost(boardCost.toSeconds());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy