org.opentripplanner.client.model.Itinerary Maven / Gradle / Ivy
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