Add method to tell if a post has already been loaded.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 9 Nov 2014 10:55:38 +0000 (11:55 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 22 Nov 2014 11:38:19 +0000 (12:38 +0100)
src/main/java/net/pterodactylus/sone/data/Post.java
src/main/java/net/pterodactylus/sone/data/impl/PostImpl.java
src/main/java/net/pterodactylus/sone/database/memory/MemoryPost.java

index 63d4b77..09198fd 100644 (file)
@@ -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
index 2d25715..4e6f6ba 100644 (file)
@@ -91,6 +91,11 @@ public class PostImpl implements Post {
                return id.toString();
        }
 
+       @Override
+       public boolean isLoaded() {
+               return true;
+       }
+
        /**
         * {@inheritDoc}
         */
index 22fa7e6..180cf6c 100644 (file)
@@ -94,6 +94,11 @@ class MemoryPost implements Post {
                return id.toString();
        }
 
+       @Override
+       public boolean isLoaded() {
+               return true;
+       }
+
        /**
         * {@inheritDoc}
         */