From 7ec5cf4d41166dab589d026256ee995068577ef2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 10 Nov 2010 20:29:25 +0100 Subject: [PATCH] Add method to check whether the core knows about a Sone. --- 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 b16165e..ad19824 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -231,6 +231,18 @@ public class Core implements IdentityListener { } /** + * Checks whether the core knows a Sone with the given ID. + * + * @param id + * The ID of the Sone + * @return {@code true} if there is a Sone with the given ID, {@code false} + * otherwise + */ + public boolean hasSone(String id) { + return isLocalSone(id) || isRemoteSone(id); + } + + /** * Returns whether the given Sone is a local Sone. * * @param sone -- 2.7.4