Subversion Repositories SmartDukaan

Rev

Rev 31285 | Rev 32438 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.model;

import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.Objects;

public class PartnerMonthlySaleModel {

        private int fofoId;
        private String yearMonth;
        private long amount;
    private static final DateTimeFormatter yearMonthFormatter = DateTimeFormatter.ofPattern("%m-%Y");

        public PartnerMonthlySaleModel(int fofoId, String yearMonth, long amount) {
                super();
                this.fofoId = fofoId;
                this.yearMonth = yearMonth;
                this.amount = amount;
        }

    public YearMonth getYearMonthObj() {
        return YearMonth.parse(this.yearMonth, yearMonthFormatter);
    }

        public int getFofoId() {
                return fofoId;
        }

        public void setFofoId(int fofoId) {
                this.fofoId = fofoId;
        }

        public String getYearMonth() {
                return yearMonth;
        }

        public void setYearMonth(String yearMonth) {
                this.yearMonth = yearMonth;
        }

        public long getAmount() {
                return amount;
        }

        public void setAmount(long amount) {
                this.amount = amount;
        }

        @Override
        public int hashCode() {
                return Objects.hash(amount, fofoId, yearMonth);
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                PartnerMonthlySaleModel other = (PartnerMonthlySaleModel) obj;
                return amount == other.amount && fofoId == other.fofoId && Objects.equals(yearMonth, other.yearMonth);
        }

        @Override
        public String toString() {
                return "PartnerMonthlySaleModel [fofoId=" + fofoId + ", yearMonth=" + yearMonth + ", amount=" + amount + "]";
        }

}