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

org.opentripplanner.netex.mapping.StopTransferPriorityMapper Maven / Gradle / Ivy

package org.opentripplanner.netex.mapping;

import javax.annotation.Nullable;
import org.opentripplanner.model.StopTransferPriority;
import org.rutebanken.netex.model.InterchangeWeightingEnumeration;

class StopTransferPriorityMapper {

    @Nullable
    static StopTransferPriority mapToDomain(InterchangeWeightingEnumeration value) {
        if(value == null) { return null; }

        switch (value) {
            case NO_INTERCHANGE: return StopTransferPriority.DISCOURAGED;
            case INTERCHANGE_ALLOWED: return StopTransferPriority.ALLOWED;
            case PREFERRED_INTERCHANGE: return StopTransferPriority.PREFERRED;
            case RECOMMENDED_INTERCHANGE: return StopTransferPriority.RECOMMENDED;
        }
        throw new IllegalArgumentException("Unsupported interchange weight: " + value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy