Turn Sone into an interface, add in-memory implementation of Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / MemoryDatabase.java
index 3c32f71..db295e8 100644 (file)
@@ -91,7 +91,7 @@ public class MemoryDatabase implements Database {
                Validation.begin().isNotNull("Sone ID", id).check();
                synchronized (localSones) {
                        if (!localSones.containsKey(id) && create) {
-                               localSones.put(id, new Sone(id, true));
+                               localSones.put(id, new MemorySone(id, true));
                        }
                        return localSones.get(id);
                }
@@ -105,7 +105,7 @@ public class MemoryDatabase implements Database {
                Validation.begin().isNotNull("Sone ID", id).check();
                synchronized (remoteSones) {
                        if (!remoteSones.containsKey(id) && create) {
-                               remoteSones.put(id, new Sone(id, false));
+                               remoteSones.put(id, new MemorySone(id, false));
                        }
                        return remoteSones.get(id);
                }