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;
import net.pterodactylus.sone.core.Options;
import net.pterodactylus.sone.database.AlbumBuilder;
import net.pterodactylus.sone.database.PostBuilder;
-import net.pterodactylus.sone.database.PostBuilderFactory;
import net.pterodactylus.sone.database.PostReplyBuilder;
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
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
-public interface Sone extends Identified, Fingerprintable, PostBuilderFactory, Comparable<Sone> {
+public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
/**
* Enumeration for the possible states of a {@link Sone}.
}
};
+ public static final Function<Sone, FreenetURI> TO_FREENET_URI = new Function<Sone, FreenetURI>() {
+ @Override
+ public FreenetURI apply(Sone sone) {
+ return (sone == null) ? null : create(sone.getIdentity().getRequestUri());
+ }
+ };
+
/**
* Returns the identity of this Sone.
*
Identity getIdentity();
/**
- * Sets the identity of this Sone. The {@link Identity#getId() ID} of the
- * identity has to match this Sone’s {@link #getId()}.
- *
- * @param identity
- * The identity of this Sone
- * @return This Sone (for method chaining)
- * @throws IllegalArgumentException
- * if the ID of the identity does not match this Sone’s ID
- */
- Sone setIdentity(Identity identity) throws IllegalArgumentException;
-
- /**
* Returns the name of this Sone.
*
* @return The name of this Sone