From: David ‘Bombe’ Roden Date: Thu, 18 Apr 2013 04:10:59 +0000 (+0200) Subject: Add predicate that identifies running downloads. X-Git-Url: https://git.pterodactylus.net/?p=xudocci.git;a=commitdiff_plain;h=9d685ddca572f2300b8e463c420de6c4d5fa6eae Add predicate that identifies running downloads. --- diff --git a/src/main/java/net/pterodactylus/xdcc/data/Download.java b/src/main/java/net/pterodactylus/xdcc/data/Download.java index 0592eaf..926adad 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Download.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Download.java @@ -24,6 +24,8 @@ import java.net.InetAddress; import net.pterodactylus.irc.DccReceiver; +import com.google.common.base.Predicate; + /** * Information about an ongoing download. * @@ -31,6 +33,15 @@ import net.pterodactylus.irc.DccReceiver; */ public class Download { + /** Predicate that identifies downloads that have started. */ + public static final Predicate FILTER_RUNNING = new Predicate() { + + @Override + public boolean apply(Download download) { + return download.dccReceiver() != null; + } + }; + /** The bot that is being downloaded from. */ private final Bot bot;