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

org.opentripplanner.netex.loader.mapping.TransferPriorityMapper Maven / Gradle / Ivy

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

import org.opentripplanner.model.TransferPriority;
import org.rutebanken.netex.model.InterchangeWeightingEnumeration;

public class TransferPriorityMapper {

    public static TransferPriority mapToDomain(InterchangeWeightingEnumeration value) {
        if(value == null) { return null; }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy