/*
- * Sone - MemoryPostReply.java - Copyright © 2013–2015 David Roden
+ * Sone - MemoryPostReply.java - Copyright © 2013–2019 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 {
*/
@Override
public Sone getSone() {
- return soneProvider.getSone(soneId).get();
+ return soneProvider.getSone(soneId);
}
/**
*/
@Override
public Optional<Post> getPost() {
- return database.getPost(postId);
+ return fromNullable(database.getPost(postId));
}
//