X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FPostProvider.java;h=19a0e5dac442b73eb9cf3efb29fcb656b4c9cf81;hb=fdb4895ff440a569367a43d4316734c88c6ee6d3;hp=edede44b920c160d0667c4e09f8e6faa16798aed;hpb=0df5e91852f737d760c5a9f54c5667309fbadcc2;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/PostProvider.java b/src/main/java/net/pterodactylus/sone/core/PostProvider.java index edede44..19a0e5d 100644 --- a/src/main/java/net/pterodactylus/sone/core/PostProvider.java +++ b/src/main/java/net/pterodactylus/sone/core/PostProvider.java @@ -1,5 +1,5 @@ /* - * Sone - PostProvider.java - Copyright © 2011 David Roden + * Sone - PostProvider.java - Copyright © 2011–2013 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 @@ -19,6 +19,8 @@ package net.pterodactylus.sone.core; import net.pterodactylus.sone.data.Post; +import com.google.common.base.Optional; + /** * Interface for objects that can provide {@link Post}s by their ID. * @@ -27,17 +29,12 @@ 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 Optional getPost(String postId); }