From: David ‘Bombe’ Roden Date: Sun, 20 Oct 2013 00:09:43 +0000 (+0200) Subject: Actually return a Sone builder. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=16cadd4cd69c0c8cbbd6bfc41257c852e6590e40;p=Sone.git Actually return a Sone builder. --- 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; + } + }; } //