org.opentripplanner.ext.legacygraphqlapi.datafetchers.LegacyGraphQLBookingTimeImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
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