+ * Sets the owner of this image. The owner can only be set if no owner has
+ * yet been set.
+ *
+ * @param sone
+ * The new owner of this image
+ * @return This image
+ */
+ public Image setSone(Sone sone) {
+ Validation.begin().isNotNull("New Image Owner", sone).isEither("Old Image Owner", this.sone, null, sone).check();
+ this.sone = sone;
+ return this;
+ }
+
+ /**
+ * Returns the album this image belongs to.
+ *
+ * @return The album this image belongs to
+ */
+ public Album getAlbum() {
+ return album;
+ }
+
+ /**
+ * Sets the album this image belongs to. The album of an image can only be
+ * set once, and it is usually called by {@link Album#addImage(Image)}.
+ *
+ * @param album
+ * The album this image belongs to
+ * @return This image
+ */
+ public Image setAlbum(Album album) {
+ Validation.begin().isNotNull("New Album", album).isEither("Old Album", this.album, null, album).check().isEqual("Album Owner and Image Owner", album.getSone(), getSone()).check();
+ this.album = album;
+ return this;
+ }
+
+ /**
+ * Returns the request key of this image.