+ * Adds the given image to this album.
+ *
+ * @param image
+ * The image to add
+ */
+ public void addImage(Image image) {
+ Validation.begin().isNotNull("Image", image).check().isNotNull("Image Owner", image.getSone()).check().isEqual("Image Owner", image.getSone(), sone).check();
+ images.add(image);
+ }
+
+ /**
+ * Removes the given image from this album.
+ *
+ * @param image
+ * The image to remove
+ */
+ public void removeImage(Image image) {
+ Validation.begin().isNotNull("Image", image).check().isEqual("Image Owner", image.getSone(), sone).check();
+ images.remove(image);
+ }
+
+ /**
+ * Returns the album image of this album, or {@code null} if no album image
+ * has been set.
+ *
+ * @return The image to show when this album is listed
+ */
+ public Image getAlbumImage() {
+ if (albumImage == -1) {
+ return null;
+ }
+ return images.get(albumImage);
+ }
+
+ /**
+ * 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() {
+ Validation.begin().isNotNull("Album Parent", parent).check();
+ this.parent = null;
+ return this;
+ }
+
+ /**