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

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

There is a newer version: 2.6.0
Show newest version
package org.opentripplanner.ext.legacygraphqlapi.datafetchers;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.opentripplanner.common.model.P2;
import org.opentripplanner.ext.legacygraphqlapi.generated.LegacyGraphQLDataFetchers;

public class LegacyGraphQLelevationProfileComponentImpl
  implements LegacyGraphQLDataFetchers.LegacyGraphQLElevationProfileComponent {

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy