Remove Identified interface
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 4d0905f..441112a 100644 (file)
@@ -48,7 +48,7 @@ import com.google.common.primitives.Ints;
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
+public interface Sone extends Fingerprintable, Comparable<Sone> {
 
        /**
         * Enumeration for the possible states of a {@link Sone}.
@@ -189,6 +189,15 @@ 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();
+               }
+       };
+
+       String getId();
+       
        /**
         * Returns the identity of this Sone.
         *