package org.aming.web.qq.domain;

import org.aming.web.qq.utils.IdGen;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * @author daming
 * @version 2017/10/5.
 */
public class Message implements Serializable {

    private static final long serialVersionUID = -7770415263565665094L;

    private String id;
    private User sendUser;
    private User receiveUser;
    private String content;
    private Timestamp sendDate;
    private int sendDeleteFlag;
    private int receiveDeleteFlag;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public User getSendUser() {
        return sendUser;
    }

    public void setSendUser(User sendUser) {
        this.sendUser = sendUser;
    }

    public User getReceiveUser() {
        return receiveUser;
    }

    public void setReceiveUser(User receiveUser) {
        this.receiveUser = receiveUser;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getSendDate() {
        return sendDate;
    }

    public void setSendDate(Timestamp sendDate) {
        this.sendDate = sendDate;
    }

    public int getSendDeleteFlag() {
        return sendDeleteFlag;
    }

    public void setSendDeleteFlag(int sendDeleteFlag) {
        this.sendDeleteFlag = sendDeleteFlag;
    }

    public int getReceiveDeleteFlag() {
        return receiveDeleteFlag;
    }

    public void setReceiveDeleteFlag(int receiveDeleteFlag) {
        this.receiveDeleteFlag = receiveDeleteFlag;
    }


    public Message() {
        super();
        this.id = IdGen.uuid();
        this.sendDeleteFlag = 0;
        this.receiveDeleteFlag = 0;
    }

    @Override
    public String toString(){
        return ToStringBuilder.reflectionToString(this);
    }
}

@@ -641,28 +641,31 @@
 %0A    public 
-void
+Message
  setId(Strin
@@ -690,24 +690,45 @@
 is.id = id;%0A
+        return this;%0A
     %7D%0A%0A    p
@@ -789,36 +789,39 @@
   %7D%0A%0A    public 
-void
+Message
  setSendUser(Use
@@ -860,32 +860,53 @@
 ser = sendUser;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -969,36 +969,39 @@
   %7D%0A%0A    public 
-void
+Message
  setReceiveUser(
@@ -1052,32 +1052,53 @@
  = receiveUser;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1159,28 +1159,31 @@
 %0A    public 
-void
+Message
  setContent(
@@ -1224,32 +1224,53 @@
 tent = content;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1271,20 +1271,25 @@
  public 
-Date
+Timestamp
  getSend
@@ -1332,36 +1332,39 @@
   %7D%0A%0A    public 
-void
+Message
  setSendDate(Tim
@@ -1408,32 +1408,53 @@
 ate = sendDate;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1526,28 +1526,31 @@
 %0A    public 
-void
+Message
  setSendDele
@@ -1616,32 +1616,53 @@
 sendDeleteFlag;%0A
+        return this;%0A
     %7D%0A%0A    publi
@@ -1748,12 +1748,15 @@
 lic 
-void
+Message
  set
@@ -1854,18 +1854,38 @@
 ag;%0A    
+    return this;%0A    
 %7D
-%0A
 %0A%0A    pu

add fluent api desgin