Module lettuce.core

Class ZAggregateArgs

java.lang.Object
io.lettuce.core.ZAggregateArgs
All Implemented Interfaces:
CompositeArgument
Direct Known Subclasses:
ZStoreArgs

public class ZAggregateArgs
extends Object
implements CompositeArgument
Argument list builder for the Redis ZUNION, ZUNIONSTORE, ZINTER and ZINTERSTORE commands. Static import the methods from ZAggregateArgs.Builder and chain the method calls: weights(1, 2).max().
Since:
6.1
Author:
Will Glozer, Xy Ma, Mark Paluch, Mikhael Sokolov
  • Constructor Details

    • ZAggregateArgs

      public ZAggregateArgs()
  • Method Details

    • weights

      public ZAggregateArgs weights​(double... weights)
      Specify a multiplication factor for each input sorted set.
      Parameters:
      weights - must not be null.
      Returns:
      this ZAggregateArgs.
    • sum

      public ZAggregateArgs sum()
      Aggregate scores of elements existing across multiple sets by summing up.
      Returns:
      this ZAggregateArgs.
    • min

      public ZAggregateArgs min()
      Aggregate scores of elements existing across multiple sets by using the lowest score.
      Returns:
      this ZAggregateArgs.
    • max

      public ZAggregateArgs max()
      Aggregate scores of elements existing across multiple sets by using the highest score.
      Returns:
      this ZAggregateArgs.
    • 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.