
org.opentripplanner.api.mapping.LocalDateMapper Maven / Gradle / Ivy
package org.opentripplanner.api.mapping;
import java.time.LocalDate;
import org.opentripplanner.util.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