

class Vehicle {

	private String vin = null;
	private String model = null;
	private String make = null;
	private int numDoors = 0;


	public Vehicle() {
		// do nothing
	}

	public Vehicle (String vin) {
		if (vin == null) {
			throw new IllegalArgumentException();
		}
		this.vin = vin;
	}

	public Vehicle(String vin, String make, String model) {
		if (vin == null || make == null || model == null) {
			throw new IllegalArgumentException();
		}
		this.vin = vin;
		this.make = make;
		this.model = model;
	}

	// getters

	public String getVIN() { return vin; }
	public String getMake() { return make; }	
	public String getModel() { return model; }
	public int getNumDoors() { return numDoors; }

	// setter

	public void setMake(String make) { 
		if (make == null) {
			throw new IllegalArgumentException();
		}
		this.make = make; 
	}

	public void setModel(String model) {
		if (model == null) {
			throw new IllegalArgumentException();
		}
		this.model = model;
	}

	public void setNumDoors(int numDoors) {
		if (numDoors < 0) {
			return;
		}
		this.numDoors = numDoors;
	}

	@Override
	public String toString() {
		return String.format("%s,%s,%s", vin, make, model);
	}

}





// End of file
