From 6794610cdd7e73db26ae74e927506396abceeea3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 8 Nov 2010 20:42:01 +0100 Subject: [PATCH] Add method to check for the remoteness of a Sone by its ID. --- src/main/java/net/pterodactylus/sone/core/Core.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 5475dc6..af1523a 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -306,6 +306,20 @@ public class Core implements IdentityListener { } /** + * Returns whether the Sone with the given ID is a remote Sone. + * + * @param id + * The ID of the Sone to check + * @return {@code true} if the Sone with the given ID is a remote Sone, + * {@code false} otherwise + */ + public boolean isRemoteSone(String id) { + synchronized (remoteSones) { + return remoteSones.containsKey(id); + } + } + + /** * Returns the post with the given ID. * * @param postId -- 2.7.4