Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
31285 tejbeer 1
package com.spice.profitmandi.dao.model;
2
 
32417 amit.gupta 3
import java.time.YearMonth;
4
import java.time.format.DateTimeFormatter;
31285 tejbeer 5
import java.util.Objects;
6
 
7
public class PartnerMonthlySaleModel {
8
 
9
	private int fofoId;
10
	private String yearMonth;
11
	private long amount;
32417 amit.gupta 12
    private static final DateTimeFormatter yearMonthFormatter = DateTimeFormatter.ofPattern("%m-%Y");
31285 tejbeer 13
 
14
	public PartnerMonthlySaleModel(int fofoId, String yearMonth, long amount) {
15
		super();
16
		this.fofoId = fofoId;
17
		this.yearMonth = yearMonth;
18
		this.amount = amount;
19
	}
20
 
32417 amit.gupta 21
    public YearMonth getYearMonthObj() {
22
        return YearMonth.parse(this.yearMonth, yearMonthFormatter);
23
    }
24
 
31285 tejbeer 25
	public int getFofoId() {
26
		return fofoId;
27
	}
28
 
29
	public void setFofoId(int fofoId) {
30
		this.fofoId = fofoId;
31
	}
32
 
33
	public String getYearMonth() {
34
		return yearMonth;
35
	}
36
 
37
	public void setYearMonth(String yearMonth) {
38
		this.yearMonth = yearMonth;
39
	}
40
 
41
	public long getAmount() {
42
		return amount;
43
	}
44
 
45
	public void setAmount(long amount) {
46
		this.amount = amount;
47
	}
48
 
49
	@Override
50
	public int hashCode() {
51
		return Objects.hash(amount, fofoId, yearMonth);
52
	}
53
 
54
	@Override
55
	public boolean equals(Object obj) {
56
		if (this == obj)
57
			return true;
58
		if (obj == null)
59
			return false;
60
		if (getClass() != obj.getClass())
61
			return false;
62
		PartnerMonthlySaleModel other = (PartnerMonthlySaleModel) obj;
63
		return amount == other.amount && fofoId == other.fofoId && Objects.equals(yearMonth, other.yearMonth);
64
	}
65
 
66
	@Override
67
	public String toString() {
68
		return "PartnerMonthlySaleModel [fofoId=" + fofoId + ", yearMonth=" + yearMonth + ", amount=" + amount + "]";
69
	}
70
 
71
}