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

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

package org.opentripplanner.api.mapping;

import java.util.List;
import java.util.Locale;
import org.opentripplanner.api.model.ApiVehicleRentalStation;
import org.opentripplanner.routing.vehicle_rental.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