Module lettuce.core

Annotation Type Command


@Retention(RUNTIME)
@Target(METHOD)
@Documented
public @interface Command
Redis command method annotation specifying a command string. A command string can contain the command name, a sequence of command string bytes and parameter references.

Parameters: Parameters can be referenced by their name :myArg or index ?0. Additional, not referenced parameters are appended to the command in the order of their appearance. Declared parameters are matched against RedisCodec for codec resolution. Additional parameter types such as Timeout control execution behavior and are not added to command arguments.

Usage:

     @Command("SET ?0 ?1")
     public String setKey(String key, String value)

     @Command("SET :key :value")
     public String setKeyNamed(@Param("key") String key, @Param("value") String value)
 

Implementation notes: A value() is split into command segments of which each segment is represented as ASCII string or parameter reference.

Since:
5.0
Author:
Mark Paluch
See Also:
CommandNaming, Param, Key, Value, RedisCodecResolver
  • Required Element Summary

    Required Elements
    Modifier and Type Required Element Description
    String value
    Command string.
  • Element Details

    • value

      String value
      Command string.