org.opentripplanner.api.mapping.StopTimesInPatternMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.api.mapping;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import org.opentripplanner.api.model.ApiStopTimesInPattern;
import org.opentripplanner.model.StopTimesInPattern;
public class StopTimesInPatternMapper {
public static List mapToApi(Collection domain) {
if (domain == null) {
return null;
}
return domain.stream().map(StopTimesInPatternMapper::mapToApi).collect(Collectors.toList());
}
public static ApiStopTimesInPattern mapToApi(StopTimesInPattern domain) {
if (domain == null) {
return null;
}
ApiStopTimesInPattern api = new ApiStopTimesInPattern();
api.pattern = TripPatternMapper.mapToApiShort(domain.pattern);
api.times = TripTimeMapper.mapToApi(domain.times);
return api;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy