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

View file

@ -81,16 +81,6 @@ public class EntryComment implements Serializable {
return comment; 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. * Returns the comment's creation date.
* *
@ -110,6 +100,16 @@ public class EntryComment implements Serializable {
return nick; 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. * 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) { public final void setNick(final String nick) {
this.nick = 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 @Override
public String toString() { public String toString() {
return "EntryLink{" + return "EntryLink{"
"comments=" + comments + + "channel='" + channel + '\''
", tags=" + tags + + ", comments=" + comments
", channel='" + channel + '\'' + + ", date=" + date
", date=" + date + + ", link='" + link + '\''
", link='" + link + '\'' + + ", login='" + login + '\''
", login='" + login + '\'' + + ", nick='" + nick + '\''
", nick='" + nick + '\'' + + ", tags=" + tags
", title='" + title + '\'' + + ", title='" + title + '\''
'}'; + '}';
} }
} }