From: David ‘Bombe’ Roden Date: Wed, 30 Mar 2011 05:29:01 +0000 (+0200) Subject: Add filter that removes not-downloaded Sones. X-Git-Tag: 0.6^2~39 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=109600515d4c561d4219fd5c977b5e205e790519;p=Sone.git Add filter that removes not-downloaded Sones. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index cc54697..a1aa6ee 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -29,6 +29,7 @@ import java.util.logging.Logger; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.template.SoneAccessor; +import net.pterodactylus.util.filter.Filter; import net.pterodactylus.util.logging.Logging; import freenet.keys.FreenetURI; @@ -56,6 +57,15 @@ public class Sone implements Fingerprintable, Comparable { }; + /** Filter to remove Sones that have not been downloaded. */ + public static final Filter EMPTY_SONE_FILTER = new Filter() { + + @Override + public boolean filterObject(Sone sone) { + return sone.getTime() != 0; + } + }; + /** The logger. */ private static final Logger logger = Logging.getLogger(Sone.class);