X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FPostProvider.java;h=d97a7ce61610f0baf62c4b85db36a2289caca24f;hp=c73ad657fbf4f46c8b505c4a0839cb7c60bef865;hb=d535f744751ba449e0f34fe3a42f1020988f14be;hpb=99888ce13cc17d49f5e217ab6f2c9ad5ef168792 diff --git a/src/main/java/net/pterodactylus/sone/core/PostProvider.java b/src/main/java/net/pterodactylus/sone/core/PostProvider.java index c73ad65..d97a7ce 100644 --- a/src/main/java/net/pterodactylus/sone/core/PostProvider.java +++ b/src/main/java/net/pterodactylus/sone/core/PostProvider.java @@ -17,6 +17,8 @@ package net.pterodactylus.sone.core; +import java.util.Collection; + import net.pterodactylus.sone.data.Post; /** @@ -27,17 +29,22 @@ import net.pterodactylus.sone.data.Post; public interface PostProvider { /** - * Returns the post with the given ID, if it exists. If it does not exist - * and {@code create} is {@code false}, {@code null} is returned; otherwise, - * a new post with the given ID is created and returned. + * Returns the post with the given ID. * * @param postId * The ID of the post to return - * @param create - * {@code true} to create a new post if no post with the given ID - * exists, {@code false} to return {@code null} instead * @return The post with the given ID, or {@code null} */ - public Post getPost(String postId, boolean create); + public Post getPost(String postId); + + /** + * Returns all posts that have the given Sone as recipient. + * + * @see Post#getRecipient() + * @param recipientId + * The ID of the recipient of the posts + * @return All posts that have the given Sone as recipient + */ + public Collection getDirectedPosts(String recipientId); }