From: David ‘Bombe’ Roden Date: Sun, 13 Nov 2011 18:49:33 +0000 (+0100) Subject: Add method to get the following time for a Sone. X-Git-Tag: 0.7.3^2~8^2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=21f2757fa8afc1d121a34679727ebe1beb25440f;p=Sone.git Add method to get the following time for a Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index d0898f1..c545236 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -591,6 +591,23 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis } /** + * Returns the time when the given was first followed by any local Sone. + * + * @param sone + * The Sone to get the time for + * @return The time (in milliseconds since Jan 1, 1970) the Sone has first + * been followed, or {@link Long#MAX_VALUE} + */ + public long getSoneFollowingTime(Sone sone) { + synchronized (soneFollowingTimes) { + if (soneFollowingTimes.containsKey(sone)) { + return soneFollowingTimes.get(sone); + } + return Long.MAX_VALUE; + } + } + + /** * Returns whether the target Sone is trusted by the origin Sone. * * @param origin