package vehicle_rental;

import java.util.ArrayList;

public class RentalDAO {
	private ArrayList<Vehicle> storage;

	public RentalDAO() {
		super();
		this.storage = new ArrayList<Vehicle>();
	}

	public ArrayList<Vehicle> getStorage() {
		return storage;
	}

	public void setStorage(ArrayList<Vehicle> storage) {
		this.storage = storage;
	}
	
	public void add(Vehicle vehicle) {
		if(vehicle == null)
			return;
		
		if(this.storage.contains(vehicle))
			return;
		
		this.storage.add(vehicle);
	}
	
	public void remove(Vehicle vehicle) {
		if(vehicle == null)
			return;
		
		if(!this.storage.contains(vehicle))
			return;
		
		this.storage.remove(vehicle);
	}
}