From: David ‘Bombe’ Roden Date: Thu, 14 Oct 2010 13:28:06 +0000 (+0200) Subject: Add method to return a Sone by its ID. X-Git-Tag: 0.1-RC1~382 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=806ebfdf165123e880dd95c50b6aeaad25e52bb2;hp=60e05f5839cc3c00610d861a24003781c3040e11;p=Sone.git Add method to return a Sone by its ID. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 4a75a03..d0d585f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -33,6 +33,7 @@ import net.pterodactylus.sone.data.PostShell; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.ReplyShell; +import net.pterodactylus.sone.data.Shell; import net.pterodactylus.sone.data.ShellCache; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.SoneShell; @@ -119,6 +120,17 @@ public class Core extends AbstractService { return Collections.unmodifiableSet(localSones); } + /** + * Returns a Sone or a {@link Shell} around one for the given ID. + * + * @param soneId + * The ID of the Sone + * @return The Sone, or a {@link Shell} around one + */ + public Sone getSone(String soneId) { + return soneCache.get(soneId); + } + // // ACTIONS //