From: David ‘Bombe’ Roden Date: Sun, 9 Nov 2014 10:55:38 +0000 (+0100) Subject: Add method to tell if a post has already been loaded. X-Git-Tag: 0.9-rc1^2~3^2~30 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=81077b2ff62eb1c94d4215bbde324a0e9d03b561;p=Sone.git Add method to tell if a post has already been loaded. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Post.java b/src/main/java/net/pterodactylus/sone/data/Post.java index 63d4b77..09198fd 100644 --- a/src/main/java/net/pterodactylus/sone/data/Post.java +++ b/src/main/java/net/pterodactylus/sone/data/Post.java @@ -62,6 +62,14 @@ public interface Post extends Identified { public String getId(); /** + * Returns whether this post has already been loaded. + * + * @return {@code true} if this post has already been loaded, {@code + * false} otherwise + */ + boolean isLoaded(); + + /** * Returns the Sone this post belongs to. * * @return The Sone of this post diff --git a/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java b/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java index 2d25715..4e6f6ba 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java @@ -91,6 +91,11 @@ public class PostImpl implements Post { return id.toString(); } + @Override + public boolean isLoaded() { + return true; + } + /** * {@inheritDoc} */ diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java index 22fa7e6..180cf6c 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java @@ -94,6 +94,11 @@ class MemoryPost implements Post { return id.toString(); } + @Override + public boolean isLoaded() { + return true; + } + /** * {@inheritDoc} */