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

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

package org.opentripplanner.api.mapping;

import org.opentripplanner.api.model.ApiTransfer;
import org.opentripplanner.model.SimpleTransfer;

public class TransferMapper {
    /** Make a transfer from a simpletransfer edge from the graph. */
    public static ApiTransfer mapToApi(SimpleTransfer domain) {
        if(domain == null) {
            return null;
        }
        ApiTransfer api = new ApiTransfer();
        api.toStopId = FeedScopedIdMapper.mapToApi(domain.to.getId());
        api.distance = domain.getDistanceMeters();
        return api;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy