Subversion Repositories SmartDukaan

Rev

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