Add method to tell if a post has already been loaded.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Post.java
index 759a8ba..09198fd 100644 (file)
@@ -45,7 +45,7 @@ public interface Post extends Identified {
 
                @Override
                public boolean apply(Post post) {
-                       return (post == null) ? false : post.getTime() <= System.currentTimeMillis();
+                       return (post != null) && (post.getTime() <= System.currentTimeMillis());
                }
 
        };
@@ -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