From 806ebfdf165123e880dd95c50b6aeaad25e52bb2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Oct 2010 15:28:06 +0200 Subject: [PATCH] Add method to return a Sone by its ID. --- src/main/java/net/pterodactylus/sone/core/Core.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 // -- 2.7.4