Use compatibility mode when getting posts
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 4d0905f..7acdb7f 100644 (file)
@@ -189,6 +189,13 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
                }
        };
 
+       Function<Sone, Collection<Post>> toAllPosts = new Function<Sone, Collection<Post>>() {
+               @Override
+               public Collection<Post> apply(@Nullable Sone sone) {
+                       return (sone != null) ? sone.getPosts() : Collections.<Post>emptyList();
+               }
+       };
+
        /**
         * Returns the identity of this Sone.
         *