X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdatabase%2FPostProvider.java;h=740373ed82818c95a481c956ed646d791b6c15fe;hp=865376bf31e4e01b3a1f12f1b76f4c1b0119c30a;hb=cf10defb0a5f633941427d56238298f1539790ed;hpb=658a702c550e15bd3c868ed399621606eeb4ef20 diff --git a/src/main/java/net/pterodactylus/sone/database/PostProvider.java b/src/main/java/net/pterodactylus/sone/database/PostProvider.java index 865376b..740373e 100644 --- a/src/main/java/net/pterodactylus/sone/database/PostProvider.java +++ b/src/main/java/net/pterodactylus/sone/database/PostProvider.java @@ -21,6 +21,8 @@ import java.util.Collection; import net.pterodactylus.sone.data.Post; +import com.google.common.base.Optional; + /** * Interface for objects that can provide {@link Post}s by their ID. * @@ -35,7 +37,16 @@ public interface PostProvider { * The ID of the post to return * @return The post with the given ID, or {@code null} */ - public Post getPost(String postId); + public Optional getPost(String postId); + + /** + * Returns all posts from the given Sone. + * + * @param soneId + * The ID of the Sone + * @return All posts from the given Sone + */ + public Collection getPosts(String soneId); /** * Returns all posts that have the given Sone as recipient.