* @return This album
*/
public Album setSone(Sone sone) {
- Validation.begin().isNotNull("New Album Owner", sone).check();
+ Validation.begin().isNotNull("New Album Owner", sone).isEither("Old Album Owner", this.sone, null, sone).check();
this.sone = sone;
return this;
}
* The album to add
*/
public void addAlbum(Album album) {
- Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.sone, sone).isNull("Album Parent", album.parent).check();
+ Validation.begin().isNotNull("Album", album).check().isEqual("Album Owner", album.sone, sone).isEither("Old Album Parent", this.parent, null, album.parent).check();
albums.add(album);
album.setParent(this);
}
* @return This album
*/
protected Album removeParent() {
- Validation.begin().isNotNull("Album Parent", parent).check();
this.parent = null;
return this;
}
* @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();
+ Validation.begin().isNotNull("New Album", album).check().isEqual("Album Owner and Image Owner", album.getSone(), getSone()).check();
this.album = album;
return this;
}