/*
- * Sone - MemoryPostReply.java - Copyright © 2013–2016 David Roden
+ * Sone - MemoryPostReply.java - Copyright © 2013–2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
package net.pterodactylus.sone.database.memory;
+import static com.google.common.base.Optional.fromNullable;
+
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.PostReply;
import net.pterodactylus.sone.data.Sone;
/**
* Memory-based {@link PostReply} implementation.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
class MemoryPostReply implements PostReply {
return database.isPostReplyKnown(this);
}
- /**
- * {@inheritDocs}
- */
- @Override
- public PostReply setKnown(boolean known) {
- database.setPostReplyKnown(this, known);
- return this;
- }
-
//
// POSTREPLY METHODS
//
*/
@Override
public Optional<Post> getPost() {
- return database.getPost(postId);
+ return fromNullable(database.getPost(postId));
}
//
return memoryPostReply.id.equals(id);
}
+ @Override
+ public String toString() {
+ return "MemoryPostReply{" +
+ "database=" + database +
+ ", soneProvider=" + soneProvider +
+ ", id='" + id + '\'' +
+ ", soneId='" + soneId + '\'' +
+ ", time=" + time +
+ ", text='" + text + '\'' +
+ ", postId='" + postId + '\'' +
+ '}';
+ }
+
}