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

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

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.api.mapping;

import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Collectors;
import org.opentripplanner.model.BookingMethod;

public class BookingMethodMapper {

    static Set mapBookingMethods(EnumSet m) {
        if (m == null) {return null;}
        return m.stream()
                .map(BookingMethodMapper::mapBookingMethods)
                .collect(Collectors.toSet());
    }

    private static String mapBookingMethods(BookingMethod m) {
        switch (m) {
            case CALL_DRIVER:
                return "CALL_DRIVER";
            case CALL_OFFICE:
                return "CALL_OFFICE";
            case ONLINE:
                return "ONLINE";
            case PHONE_AT_STOP:
                return "PHONE_AT_STOP";
            case TEXT_MESSAGE:
                return "TEXT_MESSAGE";
            default:
                return null;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy