Don’t force ID to be a UUID.
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / MemoryPost.java
index 84f3714..f5c4597 100644 (file)
@@ -17,8 +17,6 @@
 
 package net.pterodactylus.sone.database.memory;
 
-import java.util.UUID;
-
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.Sone;
 import net.pterodactylus.sone.database.SoneProvider;
@@ -34,13 +32,13 @@ import com.google.common.base.Optional;
 class MemoryPost implements Post {
 
        /** The post database. */
-       private final MemoryPostDatabase postDatabase;
+       private final MemoryDatabase postDatabase;
 
        /** The Sone provider. */
        private final SoneProvider soneProvider;
 
-       /** The GUID of the post. */
-       private final UUID id;
+       /** The ID of the post. */
+       private final String id;
 
        /** The ID of the owning Sone. */
        private final String soneId;
@@ -72,10 +70,10 @@ class MemoryPost implements Post {
         * @param text
         *            The text of the post
         */
-       public MemoryPost(MemoryPostDatabase postDatabase, SoneProvider soneProvider, String id, String soneId, String recipientId, long time, String text) {
+       public MemoryPost(MemoryDatabase postDatabase, SoneProvider soneProvider, String id, String soneId, String recipientId, long time, String text) {
                this.postDatabase = postDatabase;
                this.soneProvider = soneProvider;
-               this.id = UUID.fromString(id);
+               this.id = id;
                this.soneId = soneId;
                this.recipientId = recipientId;
                this.time = time;
@@ -91,7 +89,12 @@ class MemoryPost implements Post {
         */
        @Override
        public String getId() {
-               return id.toString();
+               return id;
+       }
+
+       @Override
+       public boolean isLoaded() {
+               return true;
        }
 
        /**