Module lettuce.core

Class MigrateArgs<K>

java.lang.Object
io.lettuce.core.MigrateArgs<K>
All Implemented Interfaces:
CompositeArgument

public class MigrateArgs<K>
extends Object
implements CompositeArgument
Argument list builder for the Redis MIGRATE command. Static import the methods from MigrateArgs.Builder and chain the method calls: copy().auth("foobar").

MigrateArgs is a mutable object and instances should be used only once to avoid shared mutable state.

Author:
Mark Paluch, dengliming
  • Constructor Details

    • MigrateArgs

      public MigrateArgs()
  • Method Details

    • copy

      public MigrateArgs<K> copy()
      Do not remove the key from the local instance by setting COPY.
      Returns:
      this MigrateArgs.
    • replace

      public MigrateArgs<K> replace()
      Replace existing key on the remote instance by setting REPLACE.
      Returns:
      this MigrateArgs.
    • key

      public MigrateArgs<K> key​(K key)
      Migrate a single key.
      Parameters:
      key - must not be null.
      Returns:
      this MigrateArgs.
    • keys

      @SafeVarargs public final MigrateArgs<K> keys​(K... keys)
      Migrate one or more keys.
      Parameters:
      keys - must not be null.
      Returns:
      this MigrateArgs.
    • keys

      public MigrateArgs<K> keys​(Iterable<K> keys)
      Migrate one or more keys.
      Parameters:
      keys - must not be null.
      Returns:
      this MigrateArgs.
    • auth

      public MigrateArgs<K> auth​(CharSequence password)
      Set AUTH password option.
      Parameters:
      password - must not be null.
      Returns:
      this MigrateArgs.
      Since:
      4.4.5
    • auth2

      public MigrateArgs<K> auth2​(CharSequence username, CharSequence password)
      Set AUTH2 username and password option.
      Parameters:
      username - must not be null.
      password - must not be null.
      Returns:
      this MigrateArgs.
      Since:
      6.1
    • auth

      public MigrateArgs<K> auth​(char[] password)
      Set AUTH password option.
      Parameters:
      password - must not be null.
      Returns:
      this MigrateArgs.
      Since:
      4.4.5
    • build

      public <K,​ V> void build​(CommandArgs<K,​V> args)
      Description copied from interface: CompositeArgument
      Build command arguments and contribute arguments to CommandArgs.

      Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.

      Specified by:
      build in interface CompositeArgument
      Type Parameters:
      K - Key type.
      V - Value type.
      Parameters:
      args - the command arguments, must not be null.