
org.opentripplanner.ext.restapi.mapping.VehicleRentalStationMapper 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
The newest version!
package org.opentripplanner.ext.restapi.mapping;
import java.util.List;
import java.util.Locale;
import org.opentripplanner.ext.restapi.model.ApiVehicleRentalStation;
import org.opentripplanner.service.vehiclerental.model.VehicleRentalPlace;
public class VehicleRentalStationMapper {
public static ApiVehicleRentalStation mapToApi(VehicleRentalPlace domain, Locale locale) {
if (domain == null) {
return null;
}
ApiVehicleRentalStation api = new ApiVehicleRentalStation();
api.id = domain.getStationId();
api.name = domain.getName().toString(locale);
api.x = domain.getLongitude();
api.y = domain.getLatitude();
api.bikesAvailable = domain.getVehiclesAvailable();
api.spacesAvailable = domain.getSpacesAvailable();
api.allowDropoff = domain.isAllowDropoff();
api.isFloatingBike = domain.isFloatingVehicle();
api.isCarStation = domain.isCarStation();
api.networks = List.of(domain.getNetwork());
api.realTimeData = domain.isRealTimeData();
api.rentalUris = domain.getRentalUris();
return api;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy