import static net.pterodactylus.sone.data.Album.IMAGES;
import java.util.Collection;
+import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
}
};
+ public static final Function<Sone, List<Album>> toAllAlbums = new Function<Sone, List<Album>>() {
+ @Override
+ public List<Album> apply(@Nullable Sone sone) {
+ return (sone == null) ? Collections.<Album>emptyList() : FLATTENER.apply(
+ sone.getRootAlbum());
+ }
+ };
+
+ public static final Function<Sone, List<Image>> toAllImages = new Function<Sone, List<Image>>() {
+ @Override
+ public List<Image> apply(@Nullable Sone sone) {
+ return (sone == null) ? Collections.<Image>emptyList() :
+ from(FLATTENER.apply(sone.getRootAlbum()))
+ .transformAndConcat(IMAGES).toList();
+ }
+ };
+
/**
* Returns the identity of this Sone.
*