X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FAlbum.java;h=67bfefdc4f0e78c4bb32bd7292260ae6bee1124c;hp=919f79743b78631dbb52cb8cc90b0a6035c52a44;hb=fef93a83c728ca853ea93872e870130512af3fcb;hpb=129815864bbd3cf5ce221eac24e29e2d0e9df036 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); } }