
org.opentripplanner.ext.restapi.mapping.LocalDateMapper 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.ext.restapi.mapping;
import java.time.LocalDate;
import org.opentripplanner.framework.time.ServiceDateUtils;
public class LocalDateMapper {
/**
* Map a LocalDate to the ISO 8601 standard YYYY-MM-DD. If the given input date is {@code null}
* or unbounded then {@code null} is returned.
*/
public static String mapToApi(LocalDate date) {
return (date == null || ServiceDateUtils.isMinMax(date)) ? null : date.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy