From 70ed282fe7a7146a8abb92450ceca75f90c20ba6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 18 Feb 2020 16:45:21 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=94=A5=20Remove=20IMAGES=20from=20Album=20?= =?utf8?q?interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/data/Album.java | 14 -------------- .../java/net/pterodactylus/sone/template/SoneAccessor.java | 4 +--- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 3eefc3e..bf8f3ec 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -17,27 +17,13 @@ package net.pterodactylus.sone.data; -import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; - -import com.google.common.base.Function; /** * Container for images that can also contain nested {@link Album}s. */ public interface Album extends Identified, Fingerprintable { - /** Function that transforms an album into the images it contains. */ - Function> IMAGES = new Function>() { - - @Override - @Nonnull - public List apply(Album album) { - return (album != null) ? album.getImages() : Collections.emptyList(); - } - }; - /** * Returns the ID of this album. * diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index 06922fc..b072dc9 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -18,8 +18,6 @@ package net.pterodactylus.sone.template; import static java.util.logging.Logger.getLogger; -import static java.util.stream.Collectors.toList; -import static net.pterodactylus.sone.data.Album.IMAGES; import java.util.logging.Level; import java.util.logging.Logger; @@ -115,7 +113,7 @@ public class SoneAccessor extends ReflectionAccessor { } return trust; } else if (member.equals("allImages")) { - return SoneKt.getAllAlbums(sone).stream().flatMap(a -> IMAGES.apply(a).stream()).collect(toList()); + return SoneKt.getAllImages(sone); } else if (member.equals("albums")) { return sone.getRootAlbum().getAlbums(); } -- 2.7.4