From f759971840aced4bf1556c062aabcb9f22796182 Mon Sep 17 00:00:00 2001 From: Mark Struchkov Date: Thu, 16 May 2019 18:36:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D1=8B=20?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BB=D0=B5=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D1=83=D1=8E=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D1=83=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/sadtech/bot/core/domain/Mail.java | 22 ++++++++++++++----- .../core/domain/attachment/AudioMessage.java | 22 +++++++++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/sadtech/bot/core/domain/Mail.java b/src/main/java/org/sadtech/bot/core/domain/Mail.java index 779f7d1..08a0746 100644 --- a/src/main/java/org/sadtech/bot/core/domain/Mail.java +++ b/src/main/java/org/sadtech/bot/core/domain/Mail.java @@ -52,6 +52,14 @@ public class Mail extends Content { return new Mail(this); } + public List getAttachments() { + return attachments; + } + + public void setAttachments(List attachments) { + this.attachments = attachments; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -68,11 +76,13 @@ public class Mail extends Content { return Objects.hash(super.hashCode(), id, date, message); } - public List getAttachments() { - return attachments; - } - - public void setAttachments(List attachments) { - this.attachments = attachments; + @Override + public String toString() { + return "Mail{" + + "id=" + id + + ", date=" + date + + ", message='" + message + '\'' + + ", attachments=" + attachments + + '}'; } } diff --git a/src/main/java/org/sadtech/bot/core/domain/attachment/AudioMessage.java b/src/main/java/org/sadtech/bot/core/domain/attachment/AudioMessage.java index 66151f6..ef6583a 100644 --- a/src/main/java/org/sadtech/bot/core/domain/attachment/AudioMessage.java +++ b/src/main/java/org/sadtech/bot/core/domain/attachment/AudioMessage.java @@ -1,6 +1,7 @@ package org.sadtech.bot.core.domain.attachment; import java.net.URL; +import java.util.Objects; public class AudioMessage extends Attachment { @@ -17,4 +18,25 @@ public class AudioMessage extends Attachment { public void setLinkOdd(URL 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 + + '}'; + } }