
org.opentripplanner.client.model.Itinerary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp-client Show documentation
Show all versions of otp-client Show documentation
Java client for the OpenTripPlanner GraphQL API
package org.opentripplanner.client.model;
import java.util.List;
import java.util.OptionalDouble;
public record Itinerary(List legs, OptionalDouble accessibilityScore) {
/** Does this itinerary contain any legs that contain public transport? */
public boolean hasTransit() {
return legs.stream().anyMatch(Leg::isTransit);
}
/**
* @return All legs that are using public transport.
*/
public List transitLegs() {
return legs.stream().filter(Leg::isTransit).toList();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy