From: David ‘Bombe’ Roden Date: Wed, 16 Jan 2013 10:40:34 +0000 (+0100) Subject: Replace utils’ filter with Guava’s predicate. X-Git-Tag: 0.8.5^2~3^2~131 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2f5fb64f08f66f2ea4f01c0b9eff685a3939624a;p=Sone.git Replace utils’ filter with Guava’s predicate. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 44b37b7..7c62e33 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -24,12 +24,13 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import net.pterodactylus.util.collection.IterableWrapper; -import net.pterodactylus.util.collection.filter.NotNullFilter; -import net.pterodactylus.util.collection.mapper.Mapper; import net.pterodactylus.util.object.Default; import net.pterodactylus.util.validation.Validation; +import com.google.common.base.Function; +import com.google.common.base.Predicates; +import com.google.common.collect.Collections2; + /** * Container for images that can also contain nested {@link Album}s. * @@ -208,15 +209,14 @@ public class Album implements Fingerprintable { * @return The images in this album */ public List getImages() { - return IterableWrapper.wrap(imageIds).map(new Mapper() { + return new ArrayList(Collections2.filter(Collections2.transform(imageIds, new Function() { @Override @SuppressWarnings("synthetic-access") - public Image map(String imageId) { + public Image apply(String imageId) { return images.get(imageId); } - - }).filter(new NotNullFilter()).list(); + }), Predicates.notNull())); } /**