From: David ‘Bombe’ Roden Date: Mon, 8 Nov 2010 19:42:01 +0000 (+0100) Subject: Add method to check for the remoteness of a Sone by its ID. X-Git-Tag: 0.2.1~24 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6794610cdd7e73db26ae74e927506396abceeea3;p=Sone.git Add method to check for the remoteness of 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 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