+ public Album setAlbumImage(String id) {
+ this.albumImage = id;
+ return this;
+ }
+
+ /**
+ * 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
+ * does not have a parent
+ */
+ public Album getParent() {
+ return parent;
+ }
+
+ /**
+ * Sets the parent album of this album.
+ *
+ * @param parent
+ * The new parent album of this album
+ * @return This album
+ */
+ protected Album setParent(Album parent) {
+ Validation.begin().isNotNull("Album Parent", parent).check();
+ this.parent = parent;
+ return this;
+ }
+
+ /**
+ * Removes the parent album of this album.
+ *
+ * @return This album
+ */
+ protected Album removeParent() {
+ this.parent = null;
+ return this;
+ }
+
+ /**
+ * Returns the title of this album.
+ *
+ * @return The title of this album
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Sets the title of this album.
+ *
+ * @param title
+ * The title of this album
+ * @return This album
+ */
+ public Album setTitle(String title) {
+ Validation.begin().isNotNull("Album Title", title).check();
+ this.title = title;