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

org.opentripplanner.ext.legacygraphqlapi.datafetchers.LegacyGraphQLBookingTimeImpl 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 java.time.format.DateTimeFormatter;
import org.opentripplanner.ext.legacygraphqlapi.generated.LegacyGraphQLDataFetchers;
import org.opentripplanner.model.BookingTime;

public class LegacyGraphQLBookingTimeImpl
  implements LegacyGraphQLDataFetchers.LegacyGraphQLBookingTime {

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

  @Override
  public DataFetcher time() {
    return environment -> getSource(environment).getTime().format(DateTimeFormatter.ISO_LOCAL_TIME);
  }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy