X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=96b1287fffbb345b8c7cd4432449423f9967347c;hb=34f280d8ca0fd772f8cde42458362252e9c0c2f7;hp=797300126e6ee728a6b190ff76f2f6cce93b8f9f;hpb=1e63e32f96c7718bd9df68eaa9a5825bfe589cf0;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 7973001..96b1287 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -19,6 +19,7 @@ package net.pterodactylus.sone.data; import static com.google.common.collect.FluentIterable.from; import static java.util.Arrays.asList; +import static net.pterodactylus.sone.core.SoneUri.create; import static net.pterodactylus.sone.data.Album.FLATTENER; import static net.pterodactylus.sone.data.Album.IMAGES; @@ -35,10 +36,10 @@ import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.template.SoneAccessor; -import freenet.keys.FreenetURI; - +import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.primitives.Ints; +import freenet.keys.FreenetURI; /** * A Sone defines everything about a user: her profile, her status updates, her @@ -170,6 +171,13 @@ public interface Sone extends Identified, Fingerprintable, Comparable { } }; + public static final Function TO_FREENET_URI = new Function() { + @Override + public FreenetURI apply(Sone sone) { + return (sone == null) ? null : create(sone.getIdentity().getRequestUri()); + } + }; + /** * Returns the identity of this Sone. *