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

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

package org.opentripplanner.ext.legacygraphqlapi.datafetchers;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.locationtech.jts.geom.Coordinate;
import org.opentripplanner.ext.legacygraphqlapi.generated.LegacyGraphQLDataFetchers;

public class LegacyGraphQLCoordinatesImpl
  implements LegacyGraphQLDataFetchers.LegacyGraphQLCoordinates {

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy