From: David ‘Bombe’ Roden Date: Thu, 18 Sep 2014 19:41:20 +0000 (+0200) Subject: Add function that returns all images for a Sone. X-Git-Tag: 0.9-rc1^2~3^2~113 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=39ad8597b568c51f095c07a8de4f5424db185d8e;p=Sone.git Add function that returns all images for a Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 6df84df..55e5fff 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -191,6 +191,15 @@ public interface Sone extends Identified, Fingerprintable, Comparable { } }; + public static final Function> toAllImages = new Function>() { + @Override + public List apply(@Nullable Sone sone) { + return (sone == null) ? Collections.emptyList() : + from(FLATTENER.apply(sone.getRootAlbum())) + .transformAndConcat(IMAGES).toList(); + } + }; + /** * Returns the identity of this Sone. *