All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.api.mapping.ServiceDateMapper Maven / Gradle / Ivy

package org.opentripplanner.api.mapping;

import org.opentripplanner.model.calendar.ServiceDate;

public class ServiceDateMapper {

    /**
     * Map a ServiceDate 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(ServiceDate date) {
        return (date == null || date.isMinMax()) ? null : date.asISO8601();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy