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

org.opentripplanner.updater.vehicle_parking.AvailabilityDatasourceFactory Maven / Gradle / Ivy

The newest version!
package org.opentripplanner.updater.vehicle_parking;

import org.opentripplanner.ext.vehicleparking.sirifm.SiriFmDatasource;
import org.opentripplanner.ext.vehicleparking.sirifm.SiriFmUpdaterParameters;
import org.opentripplanner.updater.spi.DataSource;

/**
 * Class that can be used to return a custom vehicle parking {@link DataSource}.
 */
public class AvailabilityDatasourceFactory {

  public static DataSource create(VehicleParkingUpdaterParameters parameters) {
    return switch (parameters.sourceType()) {
      case SIRI_FM -> new SiriFmDatasource((SiriFmUpdaterParameters) parameters);
      case PARK_API,
        BICYCLE_PARK_API,
        HSL_PARK,
        BIKEEP,
        NOI_OPEN_DATA_HUB,
        BIKELY -> throw new IllegalArgumentException("Cannot instantiate SIRI-FM data source");
    };
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy