Use Java 8’s predicate instead of Guava’s.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jan 2014 06:34:23 +0000 (07:34 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Jan 2014 06:34:23 +0000 (07:34 +0100)
src/main/java/net/pterodactylus/xdcc/ui/stdin/Result.java

index e8a52c1..b09b061 100644 (file)
@@ -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<Result> {
                private final List<String> 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<Result> {
        private static final Comparator<Result> packArchiveComparator = new Comparator<Result>() {
                @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;