From 16cadd4cd69c0c8cbbd6bfc41257c852e6590e40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 20 Oct 2013 02:09:43 +0200 Subject: [PATCH] Actually return a Sone builder. --- .../net/pterodactylus/sone/database/memory/MemoryDatabase.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java index 9edab57..a935b75 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java @@ -44,6 +44,7 @@ import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.Sone; +import net.pterodactylus.sone.data.impl.DefaultSoneBuilder; import net.pterodactylus.sone.database.Database; import net.pterodactylus.sone.database.DatabaseException; import net.pterodactylus.sone.database.PostDatabase; @@ -216,7 +217,14 @@ public class MemoryDatabase extends AbstractService implements Database { @Override public SoneBuilder newSoneBuilder() { - return null; + return new DefaultSoneBuilder(this) { + @Override + public Sone build(Optional soneCreated) throws IllegalStateException { + Sone sone = super.build(soneCreated); + sones.put(sone.getId(), sone); + return sone; + } + }; } // -- 2.7.4