From: David ‘Bombe’ Roden Date: Tue, 12 Apr 2011 20:00:36 +0000 (+0200) Subject: Add isEmpty() method. X-Git-Tag: beta-freefall-0.6.2-1~29 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=147ca6215b8c951ad46e56f919c077e6c0f66ee2;p=Sone.git Add isEmpty() method. --- 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