/** The ID of this album. */
private final String id;
+ /** The Sone this album belongs to. */
+ private final Sone sone;
+
/** Nested albums. */
private final List<Album> albums = new ArrayList<Album>();
/**
* Creates a new album with a random ID.
+ *
+ * @param sone
+ * The Sone this album belongs to
*/
- public Album() {
- this(UUID.randomUUID().toString());
+ public Album(Sone sone) {
+ this(UUID.randomUUID().toString(), sone);
}
/**
*
* @param id
* The ID of the album
+ * @param sone
+ * The Sone this album belongs to
*/
- public Album(String id) {
+ public Album(String id, Sone sone) {
this.id = id;
+ this.sone = sone;
}
//
}
/**
+ * Returns the Sone this album belongs to.
+ *
+ * @return The Sone this album belongs to
+ */
+ public Sone getSone() {
+ return sone;
+ }
+
+ /**
* Returns the nested albums.
*
* @return The nested albums
return false;
}
Album album = (Album) object;
- return id.equals(album.id);
+ return sone.equals(album.sone) && id.equals(album.id);
}
}