From 272580487deebd4a9e14ab9425546c0a74b6bed2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 14 Oct 2013 06:33:01 +0200 Subject: [PATCH] Add method to create a new album to Sone. --- src/main/java/net/pterodactylus/sone/data/Sone.java | 3 +++ src/main/java/net/pterodactylus/sone/data/impl/DefaultSone.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 // -- 2.7.4