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

org.opentripplanner.ext.legacygraphqlapi.datafetchers.LegacyGraphQLStoptimesInPatternImpl Maven / Gradle / Ivy

package org.opentripplanner.ext.legacygraphqlapi.datafetchers;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.opentripplanner.ext.legacygraphqlapi.generated.LegacyGraphQLDataFetchers;
import org.opentripplanner.model.StopTimesInPattern;
import org.opentripplanner.model.TripPattern;
import org.opentripplanner.model.TripTimeOnDate;

public class LegacyGraphQLStoptimesInPatternImpl
    implements LegacyGraphQLDataFetchers.LegacyGraphQLStoptimesInPattern {

  @Override
  public DataFetcher pattern() {
    return environment -> getSource(environment).pattern;
  }

  @Override
  public DataFetcher> stoptimes() {
    return environment -> getSource(environment).times;
  }

  private StopTimesInPattern getSource(DataFetchingEnvironment environment) {
    return environment.getSource();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy