package cpsc4620;

public class Discount {

	private int DiscountID;
	private String DiscountName;
	private double Amount;
	private boolean isPercent;
	
	public Discount(int discountID, String discountName, double amount, boolean isPercent) {

		DiscountID = discountID;
		DiscountName = discountName;
		Amount = amount;
		this.isPercent = isPercent;

	}

	public int getDiscountID() {
		return DiscountID;
	}

	public String getDiscountName() {
		return DiscountName;
	}

	public double getAmount() {
		return Amount;
	}

	public boolean isPercent() {
		return isPercent;
	}

	public void setDiscountID(int discountID) {
		DiscountID = discountID;
	}

	public void setDiscountName(String discountName) {
		DiscountName = discountName;
	}

	public void setAmount(double amount) {
		Amount = amount;
	}

	public void setPercent(boolean isPercent) {
		this.isPercent = isPercent;
	}

	@Override
	public String toString() {

		return "DiscountID=" + DiscountID + " | " + DiscountName + ", Amount= " + Amount
				+ ", isPercent= " + isPercent;

	}

	/**
	 * Overridden equals() method for Discount to allow comparison of Discount objects.
	 *
	 * @param o Discount object to compare against
	 * @return Whether the Discount objects are equal
	 */
	@Override
	public boolean equals(Object o) {

		if (!(o instanceof Discount)) {

			return false;

		}

		return this.getDiscountID() == ((Discount) o).getDiscountID();

	}
	
}