From: David ‘Bombe’ Roden Date: Sun, 10 Apr 2011 13:58:28 +0000 (+0200) Subject: Add method that returns whether an image has been inserted. X-Git-Tag: beta-freefall-0.6.2-1~58 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f02b9927ab88167c7ce5da4b01dc744e6a6404f2;p=Sone.git Add method that returns whether an image has been inserted. --- 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