コード例 #1
0
 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;
 }
コード例 #2
0
 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";
 }
コード例 #3
0
 public List<String> getCarList() {
   // retrieve a cache
   carCache = provider.getCacheContainer().getCache(CACHE_NAME);
   // retrieve a list of number plates from the cache
   return getNumberPlateList();
 }
コード例 #4
0
 public String showCarDetails(String numberPlate) {
   carCache = provider.getCacheContainer().getCache(CACHE_NAME);
   this.car = (Car) carCache.get(encode(numberPlate));
   return "showdetails";
 }