Class Tuple

java.lang.Object
com.couchbase.client.dcp.core.lang.Tuple

public final class Tuple extends Object
Static factory class for various Tuples.

A tuple should be used if more than one argument needs to be passed through a observable. Note that there are intentionally only tuples with a maximum of five elements, because if more are needed it hurts readability and value objects should be used instead. Also keep in mind that if a tuple is used instead of a value object semantics might get lost, so use them sparingly.

  • Method Details

    • create

      public static <T1, T2> Tuple2<T1,T2> create(T1 v1, T2 v2)
      Creates a tuple with two values.
      Parameters:
      v1 - the first value.
      v2 - the second value.
      Returns:
      a tuple containing the values.