From c8e35f0dc808fc3d7c63fb40f5479ea80b1bd1c6 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Mon, 20 Jun 2022 09:49:00 +0300 Subject: [PATCH] javadocs added --- .../org/redisson/api/RExpirableAsync.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/redisson/src/main/java/org/redisson/api/RExpirableAsync.java b/redisson/src/main/java/org/redisson/api/RExpirableAsync.java index 56094b2b6..6bae60b42 100644 --- a/redisson/src/main/java/org/redisson/api/RExpirableAsync.java +++ b/redisson/src/main/java/org/redisson/api/RExpirableAsync.java @@ -66,12 +66,48 @@ public interface RExpirableAsync extends RObjectAsync { */ RFuture expireAsync(Instant time); + /** + * Sets an expiration date for this object only if it has been already set. + * When expire date comes the object will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param time expire date + * @return true if the timeout was set and false if not + */ RFuture expireIfSetAsync(Instant time); + /** + * Sets an expiration date for this object only if it hasn't been set before. + * When expire date comes the object will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param time expire date + * @return true if the timeout was set and false if not + */ RFuture expireIfNotSetAsync(Instant time); + /** + * Sets an expiration date for this object only if it's greater than expiration date set before. + * When expire date comes the object will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param time expire date + * @return true if the timeout was set and false if not + */ RFuture expireIfGreaterAsync(Instant time); + /** + * Sets an expiration date for this object only if it's less than expiration date set before. + * When expire date comes the object will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param time expire date + * @return true if the timeout was set and false if not + */ RFuture expireIfLessAsync(Instant time); /** @@ -83,12 +119,48 @@ public interface RExpirableAsync extends RObjectAsync { */ RFuture expireAsync(Duration duration); + /** + * Sets a timeout for this object only if it has been already set. + * After the timeout has expired, the key will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param duration timeout before object will be deleted + * @return true if the timeout was set and false if not + */ RFuture expireIfSetAsync(Duration duration); + /** + * Sets a timeout for this object only if it hasn't been set before. + * After the timeout has expired, the key will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param duration timeout before object will be deleted + * @return true if the timeout was set and false if not + */ RFuture expireIfNotSetAsync(Duration duration); + /** + * Sets a timeout for this object only if it's greater than timeout set before. + * After the timeout has expired, the key will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param duration timeout before object will be deleted + * @return true if the timeout was set and false if not + */ RFuture expireIfGreaterAsync(Duration duration); + /** + * Sets a timeout for this object only if it's less than timeout set before. + * After the timeout has expired, the key will automatically be deleted. + *

+ * Requires Redis 7.0.0 and higher. + * + * @param duration timeout before object will be deleted + * @return true if the timeout was set and false if not + */ RFuture expireIfLessAsync(Duration duration); /**