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

org.opentripplanner.routing.vehicle_parking.VehicleParkingService Maven / Gradle / Ivy

package org.opentripplanner.routing.vehicle_parking;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;

public class VehicleParkingService implements Serializable {
  private static final long serialVersionUID = 1L;

  private final Set vehicleParkings = new HashSet<>();

  public void addVehicleParking(VehicleParking vehicleParking) {
    vehicleParkings.add(vehicleParking);
  }

  public void removeVehicleParking(VehicleParking vehicleParking) {
    vehicleParkings.remove(vehicleParking);
  }

  public Stream getBikeParks() {
    return vehicleParkings.stream().filter(VehicleParking::hasBicyclePlaces);
  }

  public Stream getCarParks() {
    return vehicleParkings.stream().filter(VehicleParking::hasAnyCarPlaces);
  }

  public Stream getVehicleParkings() {
    return vehicleParkings.stream();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy