org.opentripplanner.ext.legacygraphqlapi.datafetchers.LegacyGraphQLPlaceImpl Maven / Gradle / Ivy
package org.opentripplanner.ext.legacygraphqlapi.datafetchers;
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.opentripplanner.ext.legacygraphqlapi.LegacyGraphQLRequestContext;
import org.opentripplanner.ext.legacygraphqlapi.generated.LegacyGraphQLDataFetchers;
import org.opentripplanner.model.plan.Place;
import org.opentripplanner.model.plan.StopArrival;
import org.opentripplanner.model.plan.VertexType;
import org.opentripplanner.routing.RoutingService;
import org.opentripplanner.routing.bike_park.BikePark;
import org.opentripplanner.routing.bike_rental.BikeRentalStation;
import org.opentripplanner.routing.bike_rental.BikeRentalStationService;
public class LegacyGraphQLPlaceImpl implements LegacyGraphQLDataFetchers.LegacyGraphQLPlace {
@Override
public DataFetcher name() {
return environment -> getSource(environment).place.name;
}
@Override
public DataFetcher vertexType() {
return environment -> getSource(environment).place.vertexType.name();
}
@Override
public DataFetcher lat() {
return environment -> getSource(environment).place.coordinate.latitude();
}
@Override
public DataFetcher lon() {
return environment -> getSource(environment).place.coordinate.longitude();
}
@Override
public DataFetcher arrivalTime() {
return environment -> getSource(environment).arrival.getTime().getTime();
}
@Override
public DataFetcher departureTime() {
return environment -> getSource(environment).departure.getTime().getTime();
}
@Override
public DataFetcher