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

org.opentripplanner.apis.transmodel.mapping.preferences.RentalPreferencesMapper Maven / Gradle / Ivy

The newest version!
package org.opentripplanner.apis.transmodel.mapping.preferences;

import java.util.List;
import java.util.Set;
import org.opentripplanner.apis.transmodel.support.DataFetcherDecorator;
import org.opentripplanner.routing.api.request.preference.VehicleRentalPreferences;

public class RentalPreferencesMapper {

  public static void mapRentalPreferences(
    VehicleRentalPreferences.Builder rental,
    DataFetcherDecorator callWith
  ) {
    callWith.argument(
      "whiteListed.rentalNetworks",
      (List networks) -> rental.withAllowedNetworks(Set.copyOf(networks))
    );

    callWith.argument(
      "banned.rentalNetworks",
      (List networks) -> rental.withBannedNetworks(Set.copyOf(networks))
    );
    callWith.argument(
      "useBikeRentalAvailabilityInformation",
      rental::withUseAvailabilityInformation
    );
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy