All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.ext.legacygraphqlapi.datafetchers.LegacyGraphQLserviceTimeRangeImpl 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.routing.RoutingService;

public class LegacyGraphQLserviceTimeRangeImpl implements LegacyGraphQLDataFetchers.LegacyGraphQLServiceTimeRange {
    @Override
    public DataFetcher start() {
        return environment -> getRoutingService(environment).getTransitServiceStarts();
    }

    @Override
    public DataFetcher end() {
        return environment -> getRoutingService(environment).getTransitServiceEnds();
    }

    private RoutingService getRoutingService(DataFetchingEnvironment environment) {
        return environment.getContext().getRoutingService();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy