Make Image implement Fingerprintable.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 1 Jan 2011 13:39:22 +0000 (14:39 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 1 Jan 2011 13:39:22 +0000 (14:39 +0100)
src/main/java/net/pterodactylus/sone/data/Image.java

index 385c23d..6b7b1dd 100644 (file)
@@ -26,7 +26,7 @@ import net.pterodactylus.util.validation.Validation;
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
-public class Image {
+public class Image implements Fingerprintable {
 
        /** The ID of the image. */
        private final String id;
@@ -199,4 +199,22 @@ public class Image {
                return this;
        }
 
+       //
+       // FINGERPRINTABLE METHODS
+       //
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       public String getFingerprint() {
+               StringBuilder fingerprint = new StringBuilder();
+               fingerprint.append("Image(");
+               fingerprint.append("ID(").append(id).append(')');
+               fingerprint.append("Title(").append(title).append(')');
+               fingerprint.append("Description(").append(description).append(')');
+               fingerprint.append(')');
+               return fingerprint.toString();
+       }
+
 }