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

org.opentripplanner.apis.gtfs.datafetchers.CurrencyImpl Maven / Gradle / Ivy

The newest version!
package org.opentripplanner.apis.gtfs.datafetchers;

import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import java.util.Currency;
import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers;

public class CurrencyImpl implements GraphQLDataFetchers.GraphQLCurrency {

  @Override
  public DataFetcher code() {
    return env -> getSource(env).getCurrencyCode();
  }

  @Override
  public DataFetcher digits() {
    return env -> getSource(env).getDefaultFractionDigits();
  }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy