From: David ‘Bombe’ Roden Date: Mon, 14 Oct 2013 04:33:01 +0000 (+0200) Subject: Add method to create a new album to Sone. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=272580487deebd4a9e14ab9425546c0a74b6bed2;p=Sone.git Add method to create a new album to Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index d7a7dee..8180a73 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.Set; import net.pterodactylus.sone.core.Options; +import net.pterodactylus.sone.database.AlbumBuilder; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.template.SoneAccessor; @@ -546,4 +547,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable { /* TODO - remove this method again, maybe add an option provider */ void setOptions(Options options); + AlbumBuilder newAlbumBuilder(); + } diff --git a/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java b/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java index f519ffa..61bd530 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java @@ -36,6 +36,7 @@ import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.Sone; +import net.pterodactylus.sone.database.AlbumBuilder; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.util.logging.Logging; @@ -104,7 +105,7 @@ public class DefaultSone implements Sone { private final Set likedReplyIds = new CopyOnWriteArraySet(); /** The root album containing all albums. */ - private final Album rootAlbum = new DefaultAlbum(this, null); + private final DefaultAlbum rootAlbum = new DefaultAlbum(this, null); /** Sone-specific options. */ private Options options = new Options(); @@ -664,6 +665,11 @@ public class DefaultSone implements Sone { this.options = options; } + @Override + public AlbumBuilder newAlbumBuilder() { + return new DefaultAlbumBuilder(this, rootAlbum); + } + // // FINGERPRINTABLE METHODS //