Module lettuce.core

Class CommandArgsAccessor

java.lang.Object
io.lettuce.core.protocol.CommandArgsAccessor

public class CommandArgsAccessor
extends Object
Accessor for first encoded key, first string and first integer argument of CommandArgs. This class is part of the internal API and may change without further notice.
Since:
4.4
Author:
Mark Paluch
  • Constructor Details

    • CommandArgsAccessor

      public CommandArgsAccessor()
  • Method Details

    • encodeFirstKey

      public static <K,​ V> ByteBuffer encodeFirstKey​(CommandArgs<K,​V> commandArgs)
      Get the first encoded key for cluster command routing.
      Parameters:
      commandArgs - must not be null.
      Returns:
      the first encoded key or null.
    • getFirstString

      public static <K,​ V> String getFirstString​(CommandArgs<K,​V> commandArgs)
      Get the first String argument.
      Parameters:
      commandArgs - must not be null.
      Returns:
      the first String argument or null.
    • getFirstCharArray

      public static <K,​ V> char[] getFirstCharArray​(CommandArgs<K,​V> commandArgs)
      Get the first char[]-array argument.
      Parameters:
      commandArgs - must not be null.
      Returns:
      the first String argument or null.
    • getStringArguments

      public static <K,​ V> List<String> getStringArguments​(CommandArgs<K,​V> commandArgs)
      Get the all String arguments.
      Parameters:
      commandArgs - must not be null.
      Returns:
      the first String argument or null.
      Since:
      6.0
    • getCharArrayArguments

      public static <K,​ V> List<char[]> getCharArrayArguments​(CommandArgs<K,​V> commandArgs)
      Get the all char[] arguments.
      Parameters:
      commandArgs - must not be null.
      Returns:
      the first String argument or null.
      Since:
      6.0
    • getFirstInteger

      public static <K,​ V> Long getFirstInteger​(CommandArgs<K,​V> commandArgs)
      Get the first integer argument.
      Parameters:
      commandArgs - must not be null.
      Returns:
      the first integer argument or null.