From 5a7d1c53bac5edd913e483852758660665413ffa Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 21 Jan 2014 07:34:23 +0100 Subject: [PATCH] =?utf8?q?Use=20Java=208=E2=80=99s=20predicate=20instead?= =?utf8?q?=20of=20Guava=E2=80=99s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/xdcc/ui/stdin/Result.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/Result.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/Result.java index e8a52c1..b09b061 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/Result.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/Result.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.List; +import java.util.function.Predicate; import java.util.regex.Pattern; import net.pterodactylus.xdcc.core.Core; @@ -31,7 +32,6 @@ import net.pterodactylus.xdcc.data.Download; import net.pterodactylus.xdcc.data.Pack; import com.google.common.base.Function; -import com.google.common.base.Predicate; import com.google.common.collect.ComparisonChain; /** @@ -48,7 +48,7 @@ public class Result implements Comparable { private final List archiveSuffixes = Arrays.asList("rar", "tar", "zip", "tar.gz", "tar.bz2", "tar.lzma", "7z"); @Override - public boolean apply(Result result) { + public boolean test(Result result) { for (String suffix : archiveSuffixes) { if (result.pack().name().toLowerCase().endsWith(suffix)) { return true; @@ -65,10 +65,10 @@ public class Result implements Comparable { private static final Comparator packArchiveComparator = new Comparator() { @Override public int compare(Result leftResult, Result rightResult) { - if (isArchive.apply(leftResult) && !isArchive.apply(rightResult)) { + if (isArchive.test(leftResult) && !isArchive.test(rightResult)) { return 1; } - if (!isArchive.apply(leftResult) && isArchive.apply(rightResult)) { + if (!isArchive.test(leftResult) && isArchive.test(rightResult)) { return -1; } return 0; -- 2.7.4