From 72242bb0a4fc126c1a82cdc99cf5bbf8646b434e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 20 Apr 2011 14:28:57 +0200 Subject: [PATCH] Use Mappers instead of Converters. --- src/main/java/net/pterodactylus/sone/web/SearchPage.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index 74bfd10..6f5e001 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -32,8 +32,8 @@ import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Profile.Field; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.Sone; -import net.pterodactylus.util.collection.Converter; -import net.pterodactylus.util.collection.Converters; +import net.pterodactylus.util.collection.Mapper; +import net.pterodactylus.util.collection.Mappers; import net.pterodactylus.util.collection.Pagination; import net.pterodactylus.util.filter.Filter; import net.pterodactylus.util.filter.Filters; @@ -105,8 +105,8 @@ public class SearchPage extends SoneTemplatePage { Collections.sort(sortedPostHits, Hit.DESCENDING_COMPARATOR); /* extract Sones and posts. */ - List resultSones = Converters.convertList(sortedSoneHits, new HitConverter()); - List resultPosts = Converters.convertList(sortedPostHits, new HitConverter()); + List resultSones = Mappers.mappedList(sortedSoneHits, new HitMapper()); + List resultPosts = Mappers.mappedList(sortedPostHits, new HitMapper()); /* pagination. */ Pagination sonePagination = new Pagination(resultSones, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("sonePage"), 0)); @@ -480,13 +480,13 @@ public class SearchPage extends SoneTemplatePage { * The type of the object to extract * @author David ‘Bombe’ Roden */ - public static class HitConverter implements Converter, T> { + public static class HitMapper implements Mapper, T> { /** * {@inheritDoc} */ @Override - public T convert(Hit input) { + public T map(Hit input) { return input.getObject(); } -- 2.7.4