public String removeCar(String numberPlate) { carCache = provider.getCacheContainer().getCache(CACHE_NAME); carCache.remove(encode(numberPlate)); List<String> carNumbers = getNumberPlateList(); carNumbers.remove(numberPlate); carCache.replace(CAR_NUMBERS_KEY, carNumbers); return null; }
public String addNewCar() { carCache = provider.getCacheContainer().getCache(CACHE_NAME); carCache.put(CarManager.encode(car.getNumberPlate()), car); List<String> carNumbers = getNumberPlateList(); if (carNumbers == null) carNumbers = new LinkedList<>(); carNumbers.add(car.getNumberPlate()); carCache.replace(CAR_NUMBERS_KEY, carNumbers); return "home"; }