Clss Message : ajout attribut user et replyTo

This commit is contained in:
Notmoo 2017-07-26 19:52:04 +02:00
parent 99093a39c7
commit c411409249

View File

@ -1,6 +1,7 @@
package com.pqt.core.entities.messages;
import com.pqt.core.entities.members.PqtMember;
import com.pqt.core.entities.user_account.Account;
import java.util.ArrayList;
import java.util.HashMap;
@ -12,15 +13,19 @@ public class Message {
private Map<String, String> fields;
private MessageType type;
private PqtMember emitter, receiver;
private Account user;
private Message replyTo;
public Message(MessageType type, PqtMember emitter, PqtMember receiver) {
this(type, emitter, receiver, null);
public Message(MessageType type, PqtMember emitter, PqtMember receiver, Account user, Message replyTo) {
this(type, emitter, receiver, user, replyTo, null);
}
public Message(MessageType type, PqtMember emitter, PqtMember receiver, Map<String, String> fields) {
public Message(MessageType type, PqtMember emitter, PqtMember receiver, Account user, Message replyTo, Map<String, String> fields) {
this.emitter = emitter;
this.receiver = receiver;
this.type = type;
this.user = user;
this.replyTo = replyTo;
this.fields = new HashMap<>();
if(fields!=null)
for(String key : fields.keySet()){
@ -51,4 +56,12 @@ public class Message {
public MessageType getType() {
return type;
}
public Account getUser() {
return user;
}
public Message getReplyTo() {
return replyTo;
}
}