import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.database.SoneProvider;
+import net.pterodactylus.sone.database.Database;
import com.google.common.base.Optional;
*/
public class PostImpl implements Post {
- /** The Sone provider. */
- private final SoneProvider soneProvider;
+ private final Database database;
/** The GUID of the post. */
private final UUID id;
/**
* Creates a new post.
*
- * @param soneProvider
- * The Sone provider
+ * @param database
+ * The database
* @param id
* The ID of the post
* @param soneId
* @param text
* The text of the post
*/
- public PostImpl(SoneProvider soneProvider, String id, String soneId, String recipientId, long time, String text) {
- this.soneProvider = soneProvider;
+ public PostImpl(Database database, String id, String soneId, String recipientId, long time, String text) {
+ this.database = database;
this.id = UUID.fromString(id);
this.soneId = soneId;
this.recipientId = recipientId;
*/
@Override
public Sone getSone() {
- return soneProvider.getSone(soneId).get();
+ return database.getSone(soneId).get();
}
/**
*/
@Override
public Optional<Sone> getRecipient() {
- return soneProvider.getSone(recipientId);
+ return database.getSone(recipientId);
}
/**