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

org.opentripplanner.client.query.GraphQLQueries Maven / Gradle / Ivy

There is a newer version: 0.1.9
Show newest version
package org.opentripplanner.client.query;

import java.util.Objects;
import java.util.Scanner;

public class GraphQLQueries {

  public static String vehicleRentalStations() {
    return loadQuery("vehicleRentalStations");
  }

  public static String plan() {
    return loadQuery("plan");
  }

  public static String routes() {
    return loadQuery("routes");
  }

  public static String patterns() {
    return loadQuery("patterns");
  }

  public static String agencies() {
    return loadQuery("agencies");
  }

  public static String stop() {
    return loadQuery("stop");
  }

  public static String stops() {
    return loadQuery("stops");
  }

  public static String alerts() {
    return loadQuery("alerts");
  }

  private static String loadQuery(String name) {
    var is =
        GraphQLQueries.class
            .getClassLoader()
            .getResourceAsStream("queries/%s.graphql".formatted(name));
    Objects.requireNonNull(is);
    var s = new Scanner(is).useDelimiter("\\A");
    return s.hasNext() ? s.next() : "";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy