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

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

There is a newer version: 2.5.0
Show newest version
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