Return local Sones from core and web interface.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 71dd349..b485445 100644 (file)
@@ -55,6 +55,7 @@ import net.pterodactylus.sone.core.event.SoneRemovedEvent;
 import net.pterodactylus.sone.core.event.SoneUnlockedEvent;
 import net.pterodactylus.sone.data.Album;
 import net.pterodactylus.sone.data.Image;
+import net.pterodactylus.sone.data.LocalSone;
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.PostReply;
 import net.pterodactylus.sone.data.Reply;
@@ -326,27 +327,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                return database.getSone(id);
        }
 
-       /**
-        * {@inheritDocs}
-        */
        @Override
-       public Collection<Sone> getLocalSones() {
+       public Collection<LocalSone> getLocalSones() {
                return database.getLocalSones();
        }
 
-       /**
-        * Returns the local Sone with the given ID, optionally creating a new Sone.
-        *
-        * @param id
-        *            The ID of the Sone
-        * @return The Sone with the given ID, or {@code null}
-        */
-       public Sone getLocalSone(String id) {
-               Optional<Sone> sone = database.getSone(id);
-               if (sone.isPresent() && sone.get().isLocal()) {
-                       return sone.get();
-               }
-               return null;
+       public Optional<LocalSone> getLocalSone(String id) {
+               return database.getLocalSone(id);
        }
 
        /**