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.
Modifier and Type | Method and Description |
---|---|
static <T1,T2> Tuple2<T1,T2> |
create(T1 v1,
T2 v2)
Creates a tuple with two values.
|
static <T1,T2,T3> Tuple3<T1,T2,T3> |
create(T1 v1,
T2 v2,
T3 v3)
Creates a tuple with three values.
|
static <T1,T2,T3,T4> |
create(T1 v1,
T2 v2,
T3 v3,
T4 v4)
Creates a tuple with four values.
|
static <T1,T2,T3,T4,T5> |
create(T1 v1,
T2 v2,
T3 v3,
T4 v4,
T5 v5)
Creates a tuple with five values.
|
public static <T1,T2> Tuple2<T1,T2> create(T1 v1, T2 v2)
Creates a tuple with two values.
v1
- the first value.v2
- the second value.public static <T1,T2,T3> Tuple3<T1,T2,T3> create(T1 v1, T2 v2, T3 v3)
Creates a tuple with three values.
v1
- the first value.v2
- the second value.v3
- the third value.public static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4> create(T1 v1, T2 v2, T3 v3, T4 v4)
Creates a tuple with four values.
v1
- the first value.v2
- the second value.v3
- the third value.v4
- the fourth value.public static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5> create(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5)
Creates a tuple with five values.
v1
- the first value.v2
- the second value.v3
- the third value.v4
- the fourth value.v5
- the fifth value.Copyright © 2018 Couchbase, Inc.. All rights reserved.