From a0c7812d68c90e6807c768d706484f599090d270 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 8 Jun 2011 13:23:07 +0200 Subject: [PATCH] Add filter for local Sones. --- src/main/java/net/pterodactylus/sone/data/Sone.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 715d95b..e1c0391 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -27,8 +27,10 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.core.Options; import net.pterodactylus.sone.freenet.wot.Identity; +import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.util.filter.Filter; import net.pterodactylus.util.logging.Logging; @@ -67,6 +69,16 @@ public class Sone implements Fingerprintable, Comparable { } }; + /** Filter that matches all {@link Core#isLocalSone(Sone) local Sones}. */ + public static final Filter LOCAL_SONE_FILTER = new Filter() { + + @Override + public boolean filterObject(Sone sone) { + return sone.getIdentity() instanceof OwnIdentity; + } + + }; + /** The logger. */ private static final Logger logger = Logging.getLogger(Sone.class); -- 2.7.4