From f02b9927ab88167c7ce5da4b01dc744e6a6404f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 10 Apr 2011 15:58:28 +0200 Subject: [PATCH] Add method that returns whether an image has been inserted. --- src/main/java/net/pterodactylus/sone/data/Image.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/Image.java b/src/main/java/net/pterodactylus/sone/data/Image.java index 2afb098..f38a4fa 100644 --- a/src/main/java/net/pterodactylus/sone/data/Image.java +++ b/src/main/java/net/pterodactylus/sone/data/Image.java @@ -131,6 +131,18 @@ public class Image implements Fingerprintable { } /** + * Returns whether the image has already been inserted. An image is + * considered as having been inserted it its {@link #getKey() key} is not + * {@code null}. + * + * @return {@code true} if there is a key for this image, {@code false} + * otherwise + */ + public boolean isInserted() { + return key != null; + } + + /** * Returns the creation time of this image. * * @return The creation time of this image (in milliseconds since 1970, Jan -- 2.7.4