
org.opentripplanner.routing.api.request.ViaLocation 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
The newest version!
package org.opentripplanner.routing.api.request;
import java.time.Duration;
import java.util.Objects;
import org.opentripplanner.model.GenericLocation;
/**
* Represents a point to pass on trip.
*
* @param point Coordinates of Via point
* @param passThroughPoint Does the via point represent a pass through
* @param minSlack Minimum time that is allowed to wait for interchange.
* @param maxSlack Maximum time to wait for next departure.
*/
public record ViaLocation(
GenericLocation point,
boolean passThroughPoint,
Duration minSlack,
Duration maxSlack
) {
public static final Duration DEFAULT_MAX_SLACK = Duration.ofHours(1);
public static final Duration DEFAULT_MIN_SLACK = Duration.ofMinutes(5);
public ViaLocation {
Objects.requireNonNull(minSlack);
Objects.requireNonNull(maxSlack);
Objects.requireNonNull(point);
if (!point.isSpecified()) {
throw new IllegalArgumentException("The Via location is not specified");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy