From 026865581fc01f4fd2ba4dff2519c2e94ee4f03a Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 28 Sep 2020 14:23:42 +0200 Subject: [PATCH] Polishing #1433 Tweak Javadoc. --- .../lettuce/core/protocol/RedisCommand.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/io/lettuce/core/protocol/RedisCommand.java b/src/main/java/io/lettuce/core/protocol/RedisCommand.java index 8d8a08f7a5..d069a48d7b 100644 --- a/src/main/java/io/lettuce/core/protocol/RedisCommand.java +++ b/src/main/java/io/lettuce/core/protocol/RedisCommand.java @@ -45,27 +45,28 @@ public interface RedisCommand { void complete(); /** - * Cancel a command. + * Complete this command by attaching the given {@link Throwable exception}. + * + * @param throwable the exception + * @return {@code true} if this invocation caused this CompletableFuture to transition to a completed state, else + * {@code false} */ - void cancel(); + boolean completeExceptionally(Throwable throwable); /** - * - * @return the current command args + * Attempts to cancel execution of this command. This attempt will fail if the task has already completed, has already been + * cancelled, or could not be cancelled for some other reason. */ - CommandArgs getArgs(); + void cancel(); /** - * - * @param throwable the exception - * @return {@code true} if this invocation caused this CompletableFuture to transition to a completed state, else - * {@code false} + * @return the current command args. */ - boolean completeExceptionally(Throwable throwable); + CommandArgs getArgs(); /** * - * @return the Redis command type like {@literal SADD}, {@literal HMSET}, {@literal QUIT}. + * @return the Redis command type like {@code SADD}, {@code HMSET}, {@code QUIT}. */ ProtocolKeyword getType(); @@ -77,14 +78,19 @@ public interface RedisCommand { void encode(ByteBuf buf); /** + * Returns {@code true} if this task was cancelled before it completed normally. * - * @return true if the command is cancelled. + * @return {@code true} if the command was cancelled before it completed normally. */ boolean isCancelled(); /** + * Returns {@code true} if this task completed. + * + * Completion may be due to normal termination, an exception, or cancellation. In all of these cases, this method will + * return {@code true}. * - * @return true if the command is completed. + * @return {@code true} if this task completed. */ boolean isDone();