Subversion Repositories SmartDukaan

Rev

Rev 31903 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26588 tejbeer 1
package com.spice.profitmandi.dao.model;
2
 
31903 amit.gupta 3
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
26588 tejbeer 4
 
31903 amit.gupta 5
import java.util.Objects;
26588 tejbeer 6
 
31903 amit.gupta 7
public class AmountModel {
8
 
9
	private double amount;
10
	private AmountType amountType;
11
	private double value;
32021 amit.gupta 12
	private boolean discount = false;
31903 amit.gupta 13
 
14
	public AmountModel() {
15
	}
16
 
17
	public AmountModel(double amount, AmountType amountType) {
18
		this.amount = amount;
19
		this.amountType = amountType;
20
	}
21
 
22
	public double getValue() {
26588 tejbeer 23
		return value;
24
	}
25
 
31903 amit.gupta 26
	public void setValue(double value) {
26588 tejbeer 27
		this.value = value;
28
	}
29
 
31903 amit.gupta 30
	public double getAmount() {
31
		return amount;
32
	}
26675 tejbeer 33
 
31903 amit.gupta 34
	public void setAmount(double amount) {
35
		this.amount = amount;
36
	}
37
 
38
	public AmountType getAmountType() {
39
		return amountType;
40
	}
41
 
42
	public void setAmountType(AmountType amountType) {
43
		this.amountType = amountType;
44
	}
32021 amit.gupta 45
 
46
	public boolean isDiscount() {
47
		return discount;
48
	}
49
 
50
	public void setDiscount(boolean discount) {
51
		this.discount = discount;
52
	}
53
 
54
	@Override
55
	public boolean equals(Object o) {
56
		if (this == o) return true;
57
		if (o == null || getClass() != o.getClass()) return false;
58
		AmountModel that = (AmountModel) o;
59
		return Double.compare(that.amount, amount) == 0 && Double.compare(that.value, value) == 0 && discount == that.discount && amountType == that.amountType;
60
	}
61
 
62
	@Override
63
	public int hashCode() {
64
		return Objects.hash(amount, amountType, value, discount);
65
	}
66
 
67
	@Override
68
	public String toString() {
69
		return "AmountModel{" +
70
				"amount=" + amount +
71
				", amountType=" + amountType +
72
				", value=" + value +
73
				", discount=" + discount +
74
				'}';
75
	}
26588 tejbeer 76
}