НеДобавил фильтры и паралельную обработку событий

This commit is contained in:
Mark Struchkov 2019-05-16 18:36:23 +03:00
parent 1436331d61
commit f759971840
2 changed files with 38 additions and 6 deletions

View File

@ -52,6 +52,14 @@ public class Mail extends Content {
return new Mail(this); return new Mail(this);
} }
public List<Attachment> getAttachments() {
return attachments;
}
public void setAttachments(List<Attachment> attachments) {
this.attachments = attachments;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
@ -68,11 +76,13 @@ public class Mail extends Content {
return Objects.hash(super.hashCode(), id, date, message); return Objects.hash(super.hashCode(), id, date, message);
} }
public List<Attachment> getAttachments() { @Override
return attachments; public String toString() {
} return "Mail{" +
"id=" + id +
public void setAttachments(List<Attachment> attachments) { ", date=" + date +
this.attachments = attachments; ", message='" + message + '\'' +
", attachments=" + attachments +
'}';
} }
} }

View File

@ -1,6 +1,7 @@
package org.sadtech.bot.core.domain.attachment; package org.sadtech.bot.core.domain.attachment;
import java.net.URL; import java.net.URL;
import java.util.Objects;
public class AudioMessage extends Attachment { public class AudioMessage extends Attachment {
@ -17,4 +18,25 @@ public class AudioMessage extends Attachment {
public void setLinkOdd(URL linkOdd) { public void setLinkOdd(URL linkOdd) {
this.linkOdd = linkOdd; this.linkOdd = linkOdd;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof AudioMessage)) return false;
AudioMessage that = (AudioMessage) o;
return Objects.equals(linkOdd, that.linkOdd);
}
@Override
public int hashCode() {
return Objects.hash(linkOdd);
}
@Override
public String toString() {
return "AudioMessage{" +
"linkOdd=" + linkOdd +
", type=" + type +
'}';
}
} }