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();
}
}