From 147ca6215b8c951ad46e56f919c077e6c0f66ee2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 12 Apr 2011 22:00:36 +0200 Subject: [PATCH] Add isEmpty() method. --- src/main/java/net/pterodactylus/sone/data/Album.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 88bef2c..d7df845 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -187,6 +187,15 @@ public class Album implements Fingerprintable { } /** + * Returns whether this album contains any other albums or images. + * + * @return {@code true} if this album is empty, {@code false} otherwise + */ + public boolean isEmpty() { + return albums.isEmpty() && images.isEmpty(); + } + + /** * Returns the parent album of this album. * * @return The parent album of this album, or {@code null} if this album -- 2.7.4