From: David ‘Bombe’ Roden Date: Sat, 1 Jan 2011 12:49:35 +0000 (+0100) Subject: Add owner Sone to album. X-Git-Tag: beta-freefall-0.6.2-1~150 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fef93a83c728ca853ea93872e870130512af3fcb;p=Sone.git Add owner Sone to album. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 919f797..67bfefd 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -31,6 +31,9 @@ public class Album { /** The ID of this album. */ private final String id; + /** The Sone this album belongs to. */ + private final Sone sone; + /** Nested albums. */ private final List albums = new ArrayList(); @@ -45,9 +48,12 @@ public class 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); } /** @@ -55,9 +61,12 @@ public class Album { * * @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; } // @@ -74,6 +83,15 @@ public class Album { } /** + * 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 @@ -146,7 +164,7 @@ public class Album { return false; } Album album = (Album) object; - return id.equals(album.id); + return sone.equals(album.sone) && id.equals(album.id); } }