Add method to set all albums of a Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Album.java
index 16c9916..601e68d 100644 (file)
@@ -157,7 +157,7 @@ public class Album implements Fingerprintable {
         *            The image to add
         */
        public void addImage(Image image) {
-               Validation.begin().isNotNull("Image", image).check().isEqual("Image Owner", image.getSone(), sone).check();
+               Validation.begin().isNotNull("Image", image).check().isNotNull("Image Owner", image.getSone()).check().isEqual("Image Owner", image.getSone(), sone).check();
                images.add(image);
        }
 
@@ -304,6 +304,14 @@ public class Album implements Fingerprintable {
         * {@inheritDoc}
         */
        @Override
+       public int hashCode() {
+               return id.hashCode();
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
        public boolean equals(Object object) {
                if (!(object instanceof Album)) {
                        return false;