ReminderItem.java 1.03 KB
Newer Older
konghaorui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
package com.yidianling.im.bean;

import java.io.Serializable;

public class ReminderItem implements Serializable {
    private static final long serialVersionUID = -2101649256143239157L;

    protected final int id;

    private int unread;

    private boolean indicator;

    public ReminderItem(int id) {
        this.id = id;
        this.unread = 0;
    }

    public int getId() {
        return id;
    }

    public int unread() {
        return unread;
    }

    public boolean indicator() {
        return unread <= 0 && indicator;
    }

    public int getUnread() {
        return unread;
    }

    public void setUnread(int unread) {
        this.unread = unread;
    }

    public void setIndicator(boolean indicator) {
        this.indicator = indicator;
    }

    /*package*/ ReminderItem copy() {
        ReminderItem item = new ReminderItem(id);
        copyData(item);
        return item;
    }

    protected void copyData(ReminderItem item) {
        item.unread = this.unread;
        item.indicator = this.indicator;
    }
}