package com.sf._04_set_contact.demo2;

import java.util.Objects;

/**
 * 兑换记录类
 */
public class ExchangeRecord {
    // 会员信息
    private Member member;
    // 兑换商品信息
    private ExchangeGoods exchangeGoods;
    // 兑换日期
    private String date;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ExchangeRecord that = (ExchangeRecord) o;
        return Objects.equals(member, that.member) &&
                Objects.equals(exchangeGoods, that.exchangeGoods) &&
                Objects.equals(date, that.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(member, exchangeGoods, date);
    }

    public ExchangeRecord() {
    }

    public ExchangeRecord(Member member, ExchangeGoods exchangeGoods, String date) {
        this.member = member;
        this.exchangeGoods = exchangeGoods;
        this.date = date;
    }

    /**
     * 获取
     * @return member
     */
    public Member getMember() {
        return member;
    }

    /**
     * 设置
     * @param member
     */
    public void setMember(Member member) {
        this.member = member;
    }

    /**
     * 获取
     * @return exchangeGoods
     */
    public ExchangeGoods getExchangeGoods() {
        return exchangeGoods;
    }

    /**
     * 设置
     * @param exchangeGoods
     */
    public void setExchangeGoods(ExchangeGoods exchangeGoods) {
        this.exchangeGoods = exchangeGoods;
    }

    /**
     * 获取
     * @return date
     */
    public String getDate() {
        return date;
    }

    /**
     * 设置
     * @param date
     */
    public void setDate(String date) {
        this.date = date;
    }

    public String toString() {
        return "ExchangeRecord{member = " + member + ", exchangeGoods = " + exchangeGoods + ", date = " + date + "}";
    }
}
