package vehicle_rental;

public class Vehicle {
	private int id;
	private String brand;
	private boolean rendted;

	public Vehicle(int id, String brand, boolean rendted) {
		super();
		this.id = id;
		this.brand = brand;
		this.rendted = rendted;
	}

	@Override
	public String toString() {
		return "Vehicle [id=" + id + ", brand=" + brand + ", rendted=" + rendted + "]";
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public boolean isRendted() {
		return rendted;
	}

	public void setRendted(boolean rendted) {
		this.rendted = rendted;
	}

	public void drive() {
		System.out.println("Vehicle is driving.");
	}
	
	public void printCategory() {
		System.out.println("This is a Vehcile.");
	}
	
	public void rent() throws VehicleAlreadyRentedException {
		if(this.rendted == true)
			throw new VehicleAlreadyRentedException("Vehicle is already rented!");
		
		this.rendted = true;
		System.out.println("Vehicle rented.");	
	}

	public Vehicle returnVehicle() {
		return this;
	}
}