X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=7acdb7ff2d43a291f069dab0c98e62146a5be72a;hb=64abaf4ca1924732a99eeb9f1f461acbeda82a43;hp=e64a388f14959cf67b984662bab02e76f1d67112;hpb=712df9d632bffa80cb46620b44e2db399b1a6e7f;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index e64a388..7acdb7f 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -35,6 +35,7 @@ import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.template.SoneAccessor; +import com.google.common.base.Optional; import freenet.keys.FreenetURI; import com.google.common.base.Function; @@ -188,6 +189,13 @@ public interface Sone extends Identified, Fingerprintable, Comparable { } }; + Function> toAllPosts = new Function>() { + @Override + public Collection apply(@Nullable Sone sone) { + return (sone != null) ? sone.getPosts() : Collections.emptyList(); + } + }; + /** * Returns the identity of this Sone. * @@ -502,6 +510,7 @@ public interface Sone extends Identified, Fingerprintable, Comparable { * @return The root album of this Sone */ Album getRootAlbum(); + Optional getImageByInternalId(final String internalId); /** * Returns Sone-specific options.