Archived
3
0
Fork 1

docs: update vehiclesplus-v3/api/examples

This commit is contained in:
Cedric 2024-12-28 22:30:36 +00:00 committed by SBDeveloper
parent 3ee4b30621
commit 91551c7142

View file

@ -2,7 +2,7 @@
title: Examples
description: Example usages of the api
published: false
date: 2024-12-28T22:26:48.261Z
date: 2024-12-28T22:30:33.758Z
tags: developers
editor: markdown
dateCreated: 2024-12-28T21:11:02.102Z
@ -121,7 +121,7 @@ public void removeVehicleFromPoliceGarage(String vehicleModelName) {
// Search for the vehicle with the given model name within the "police" garage
Optional<Vehicle> vehicleToRemoveOptional = policeGarage.getVehicles().stream()
// Convert the vehicle UUID to an actual StorageVehicle object
.map(vehicleUuid -> VehiclesPlusAPI.getVehicle(vehicleUuid))
.map(VehiclesPlusAPI::getVehicle)
// Filter vehicles to match the given model name
.filter(vehicle -> vehicle != null && vehicle.getVehicleModel().getId().equals(vehicleModelName))
// Select the first match