
org.opentripplanner.api.mapping.BookingInfoMapper 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 org.opentripplanner.api.model.ApiBookingInfo;
import org.opentripplanner.model.BookingInfo;
public class BookingInfoMapper {
static ApiBookingInfo mapBookingInfo(BookingInfo info, boolean isPickup) {
if (info == null) {
return null;
}
return new ApiBookingInfo(
ContactInfoMapper.mapContactInfo(info.getContactInfo()),
BookingMethodMapper.mapBookingMethods(info.bookingMethods()),
BookingTimeMapper.mapBookingTime(info.getEarliestBookingTime()),
BookingTimeMapper.mapBookingTime(info.getLatestBookingTime()),
info.getMinimumBookingNotice(),
info.getMaximumBookingNotice(),
info.getMessage(),
// we only want to show the pick up message for pickups
isPickup ? info.getPickupMessage() : null,
// and only the drop off message for drop offs
!isPickup ? info.getDropOffMessage() : null
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy