
org.opentripplanner.client.model.Route 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 com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
public record Route(
@JsonProperty("gtfsId") String id,
Optional shortName,
Optional longName,
@JsonProperty("type") int modeCode,
TransitMode mode,
Agency agency) {
/**
* Either the short name (if it has one) or the long name.
*
* Either is optional but one must exist.
*/
public String name() {
return shortName.or(() -> longName).orElseThrow();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy