From 9d685ddca572f2300b8e463c420de6c4d5fa6eae Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 18 Apr 2013 06:10:59 +0200 Subject: [PATCH] Add predicate that identifies running downloads. --- src/main/java/net/pterodactylus/xdcc/data/Download.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.7.4