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;
import net.pterodactylus.xdcc.data.Pack;
import com.google.common.base.Function;
-import com.google.common.base.Predicate;
import com.google.common.collect.ComparisonChain;
/**
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;
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;