From: David ‘Bombe’ Roden Date: Sat, 1 Jan 2011 13:39:22 +0000 (+0100) Subject: Make Image implement Fingerprintable. X-Git-Tag: beta-freefall-0.6.2-1~142 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=d9ce997ce221202a8abb66b835f1a1f55985059f;p=Sone.git Make Image implement Fingerprintable. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Image.java b/src/main/java/net/pterodactylus/sone/data/Image.java index 385c23d..6b7b1dd 100644 --- a/src/main/java/net/pterodactylus/sone/data/Image.java +++ b/src/main/java/net/pterodactylus/sone/data/Image.java @@ -26,7 +26,7 @@ import net.pterodactylus.util.validation.Validation; * * @author David ‘Bombe’ Roden */ -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(); + } + }