From 2f5fb64f08f66f2ea4f01c0b9eff685a3939624a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 16 Jan 2013 11:40:34 +0100 Subject: [PATCH] =?utf8?q?Replace=20utils=E2=80=99=20filter=20with=20Guava?= =?utf8?q?=E2=80=99s=20predicate.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/data/Album.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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())); } /** -- 2.7.4