From d9ce997ce221202a8abb66b835f1a1f55985059f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 1 Jan 2011 14:39:22 +0100 Subject: [PATCH] Make Image implement Fingerprintable. --- src/main/java/net/pterodactylus/sone/data/Image.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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(); + } + } -- 2.7.4