Added toString()

This commit is contained in:
Erik C. Thauvin 2020-04-01 11:12:43 -07:00
parent 2ffa5f29b9
commit bde70343b7
4 changed files with 44 additions and 23 deletions

View file

@ -178,4 +178,18 @@ public class TellMessage implements Serializable {
received = LocalDateTime.now(Clock.systemUTC());
isReceived = true;
}
@Override
public String toString() {
return "TellMessage{"
+ "id='" + id + '\''
+ ", isNotified=" + isNotified
+ ", isReceived=" + isReceived
+ ", message='" + message + '\''
+ ", queued=" + queued
+ ", received=" + received
+ ", recipient='" + recipient + '\''
+ ", sender='" + sender + '\''
+ '}';
}
}

View file

@ -89,7 +89,6 @@ final class TellMessagesMgr {
@SuppressWarnings("unchecked")
public static List<TellMessage> load(final String file, final Logger logger) {
try {
try (final ObjectInput input = new ObjectInputStream(
new BufferedInputStream(Files.newInputStream(Paths.get(file))))) {
if (logger.isDebugEnabled()) {
@ -116,7 +115,6 @@ final class TellMessagesMgr {
*/
public static void save(final String file, final List<TellMessage> messages, final Logger logger) {
try {
try (final ObjectOutput output = new ObjectOutputStream(
new BufferedOutputStream(Files.newOutputStream(Paths.get(file))))) {
if (logger.isDebugEnabled()) {

View file

@ -42,7 +42,7 @@ import java.time.LocalDateTime;
* @created Jan 31, 2004
* @since 1.0
*/
@SuppressWarnings({"PMD.DataClass"})
@SuppressWarnings({ "PMD.DataClass" })
public class EntryComment implements Serializable {
// Serial version UID
static final long serialVersionUID = 1L;
@ -81,16 +81,6 @@ public class EntryComment implements Serializable {
return comment;
}
/**
* Sets the comment.
*
* @param comment The actual comment.
*/
@SuppressWarnings("UnusedDeclaration")
public final void setComment(final String comment) {
this.comment = comment;
}
/**
* Returns the comment's creation date.
*
@ -110,6 +100,16 @@ public class EntryComment implements Serializable {
return nick;
}
/**
* Sets the comment.
*
* @param comment The actual comment.
*/
@SuppressWarnings("UnusedDeclaration")
public final void setComment(final String comment) {
this.comment = comment;
}
/**
* Sets the nickname of the author of the comment.
*
@ -118,4 +118,13 @@ public class EntryComment implements Serializable {
public final void setNick(final String nick) {
this.nick = nick;
}
@Override
public String toString() {
return "EntryComment{"
+ "comment='" + comment + '\''
+ ", date=" + date
+ ", nick='" + nick + '\''
+ '}';
}
}

View file

@ -404,15 +404,15 @@ public class EntryLink implements Serializable {
*/
@Override
public String toString() {
return "EntryLink{" +
"comments=" + comments +
", tags=" + tags +
", channel='" + channel + '\'' +
", date=" + date +
", link='" + link + '\'' +
", login='" + login + '\'' +
", nick='" + nick + '\'' +
", title='" + title + '\'' +
'}';
return "EntryLink{"
+ "channel='" + channel + '\''
+ ", comments=" + comments
+ ", date=" + date
+ ", link='" + link + '\''
+ ", login='" + login + '\''
+ ", nick='" + nick + '\''
+ ", tags=" + tags
+ ", title='" + title + '\''
+ '}';
}
}