Top Description Fields Constructors Methods
org.jooq.lambda.tuple

public Class Tuple2<T1, T2>

extends Object
implements Tuple, Comparable<Tuple2<T1, T2>>, Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable, java.lang.Comparable, org.jooq.lambda.tuple.Tuple, java.lang.Iterable
Known Direct Subclasses
org.jooq.lambda.tuple.Range
Imports
java.io.Serializable, java.util.Arrays, .Iterator, .LinkedHashMap, .List, .Map, .Objects, .Optional, java.util.function.BiFunction, .Function, .Supplier, org.jooq.lambda.Seq, org.jooq.lambda.function.Function1, .Function2

A tuple of degree 2.
Author
Lukas Eder

Field Summary

Modifier and TypeField and Description
private static final long
public final T1
public final T2

Constructor Summary

AccessConstructor and Description
public
Tuple2(Tuple2<T1, T2> tuple)

public
Tuple2(T1 v1, T2 v2)

Method Summary

Modifier and TypeMethod and Description
public final Object[]
array()

Implements org.jooq.lambda.tuple.Tuple.array.

Deprecated

Get an array representation of this tuple.

public Tuple2<T1, T2>
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public int
compareTo(Tuple2<T1, T2> other)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public final <T3> Tuple3<T1, T2, T3>
concat(T3 value)

Concatenate a value to this tuple.

public final <T3> Tuple3<T1, T2, T3>
concat(Tuple1<T3> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4> Tuple4<T1, T2, T3, T4>
concat(Tuple2<T3, T4> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5> Tuple5<T1, T2, T3, T4, T5>
concat(Tuple3<T3, T4, T5> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6> Tuple6<T1, T2, T3, T4, T5, T6>
concat(Tuple4<T3, T4, T5, T6> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7> Tuple7<T1, T2, T3, T4, T5, T6, T7>
concat(Tuple5<T3, T4, T5, T6, T7> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>
concat(Tuple6<T3, T4, T5, T6, T7, T8> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
concat(Tuple7<T3, T4, T5, T6, T7, T8, T9> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
concat(Tuple8<T3, T4, T5, T6, T7, T8, T9, T10> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
concat(Tuple9<T3, T4, T5, T6, T7, T8, T9, T10, T11> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
concat(Tuple10<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
concat(Tuple11<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
concat(Tuple12<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
concat(Tuple13<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> tuple)

Concatenate a tuple to this tuple.

public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
concat(Tuple14<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> tuple)

Concatenate a tuple to this tuple.

public final int
degree()

Implements org.jooq.lambda.tuple.Tuple.degree.

The degree of this tuple: 2.

public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public static final <T extends Comparable<? super T>> Optional<Tuple2<T, T>>
intersect(Tuple2<T, T> left, Tuple2<T, T> right)
Deprecated - Use Range#intersect(Range) instead.

The intersection of two ranges.

public final Iterator<Object>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public final Tuple0
limit0()

Limit this tuple to degree 0.

public final Tuple1<T1>
limit1()

Limit this tuple to degree 1.

public final Tuple2<T1, T2>
limit2()

Limit this tuple to degree 2.

public final List<?>
list()

Implements org.jooq.lambda.tuple.Tuple.list.

Deprecated

Get a list representation of this tuple.

public final <R> R
map(BiFunction<? super T1, ? super T2, ? extends R> function)

Apply this tuple as arguments to a function.

public final <U1> Tuple2<U1, T2>
map1(Function<? super T1, ? extends U1> function)

Apply attribute 1 as argument to a function and return a new tuple with the substituted argument.

public final <U2> Tuple2<T1, U2>
map2(Function<? super T2, ? extends U2> function)

Apply attribute 2 as argument to a function and return a new tuple with the substituted argument.

public static final <T extends Comparable<? super T>> boolean
overlaps(Tuple2<T, T> left, Tuple2<T, T> right)
Deprecated - Use Range#overlaps(Range) instead.

Whether two tuples overlap.

public final Tuple2<T1, T2>
skip0()

Skip 0 degrees from this tuple.

public final Tuple1<T2>
skip1()

Skip 1 degrees from this tuple.

public final Tuple0
skip2()

Skip 2 degrees from this tuple.

public final Tuple2<Tuple0, Tuple2<T1, T2>>
split0()

Split this tuple into two tuples of degree 0 and 2.

public final Tuple2<Tuple1<T1>, Tuple1<T2>>
split1()

Split this tuple into two tuples of degree 1 and 1.

public final Tuple2<Tuple2<T1, T2>, Tuple0>
split2()

Split this tuple into two tuples of degree 2 and 0.

public final Tuple2<T2, T1>
swap()

Get a tuple with the two attributes swapped.

public final Object[]
toArray()

Implements org.jooq.lambda.tuple.Tuple.toArray.

Get an array representation of this tuple.

public final List<?>
toList()

Implements org.jooq.lambda.tuple.Tuple.toList.

Get a list representation of this tuple.

public final Map<String, ?>
toMap()

Implements org.jooq.lambda.tuple.Tuple.toMap.

Get a map representation of this tuple.

public final <K> Map<K, ?>
toMap(Function<? super Integer, ? extends K> keyMapper)

Implements org.jooq.lambda.tuple.Tuple.toMap.

Get a map representation of this tuple.

public final <K> Map<K, ?>
toMap(Supplier<? extends K> keySupplier1, Supplier<? extends K> keySupplier2)

public final <K> Map<K, ?>
toMap(K key1, K key2)

public final Seq<?>
toSeq()

Implements org.jooq.lambda.tuple.Tuple.toSeq.

Get a Seq representation of this tuple.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public T1
v1()

public T2
v2()

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID
v1back to summary
public final T1 v1
v2back to summary
public final T2 v2

Constructor Detail

Tuple2back to summary
public Tuple2(Tuple2<T1, T2> tuple)
Tuple2back to summary
public Tuple2(T1 v1, T2 v2)

Method Detail

arrayback to summary
public final Object[] array()

Implements org.jooq.lambda.tuple.Tuple.array.

Doc from org.jooq.lambda.tuple.Tuple.array.

Deprecated

Get an array representation of this tuple.

Annotations
@Override
@Deprecated
cloneback to summary
public Tuple2<T1, T2> clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Annotations
@Override
compareToback to summary
public int compareTo(Tuple2<T1, T2> other)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
concatback to summary
public final <T3> Tuple3<T1, T2, T3> concat(T3 value)

Concatenate a value to this tuple.

concatback to summary
public final <T3> Tuple3<T1, T2, T3> concat(Tuple1<T3> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4> Tuple4<T1, T2, T3, T4> concat(Tuple2<T3, T4> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> concat(Tuple3<T3, T4, T5> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6> Tuple6<T1, T2, T3, T4, T5, T6> concat(Tuple4<T3, T4, T5, T6> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7> Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple5<T3, T4, T5, T6, T7> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple6<T3, T4, T5, T6, T7, T8> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9> Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> concat(Tuple7<T3, T4, T5, T6, T7, T8, T9> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10> Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> concat(Tuple8<T3, T4, T5, T6, T7, T8, T9, T10> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10, T11> Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> concat(Tuple9<T3, T4, T5, T6, T7, T8, T9, T10, T11> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> concat(Tuple10<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> concat(Tuple11<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> concat(Tuple12<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> concat(Tuple13<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> tuple)

Concatenate a tuple to this tuple.

concatback to summary
public final <T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> concat(Tuple14<T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> tuple)

Concatenate a tuple to this tuple.

degreeback to summary
public final int degree()

Implements org.jooq.lambda.tuple.Tuple.degree.

The degree of this tuple: 2.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
intersectback to summary
public static final <T extends Comparable<? super T>> Optional<Tuple2<T, T>> intersect(Tuple2<T, T> left, Tuple2<T, T> right)

Deprecated

- Use Range#intersect(Range) instead.

The intersection of two ranges.


// (2, 3)
range(1, 3).intersect(range(2, 4))

// none
range(1, 3).intersect(range(5, 8))
Annotations
@Deprecated
iteratorback to summary
public final Iterator<Object> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override
@SuppressWarnings:unchecked
limit0back to summary
public final Tuple0 limit0()

Limit this tuple to degree 0.

limit1back to summary
public final Tuple1<T1> limit1()

Limit this tuple to degree 1.

limit2back to summary
public final Tuple2<T1, T2> limit2()

Limit this tuple to degree 2.

listback to summary
public final List<?> list()

Implements org.jooq.lambda.tuple.Tuple.list.

Doc from org.jooq.lambda.tuple.Tuple.list.

Deprecated

Get a list representation of this tuple.

Annotations
@Override
@Deprecated
mapback to summary
public final <R> R map(BiFunction<? super T1, ? super T2, ? extends R> function)

Apply this tuple as arguments to a function.

map1back to summary
public final <U1> Tuple2<U1, T2> map1(Function<? super T1, ? extends U1> function)

Apply attribute 1 as argument to a function and return a new tuple with the substituted argument.

map2back to summary
public final <U2> Tuple2<T1, U2> map2(Function<? super T2, ? extends U2> function)

Apply attribute 2 as argument to a function and return a new tuple with the substituted argument.

overlapsback to summary
public static final <T extends Comparable<? super T>> boolean overlaps(Tuple2<T, T> left, Tuple2<T, T> right)

Deprecated

- Use Range#overlaps(Range) instead.

Whether two tuples overlap.


// true
range(1, 3).overlaps(range(2, 4))

// false
range(1, 3).overlaps(range(5, 8))
Annotations
@Deprecated
skip0back to summary
public final Tuple2<T1, T2> skip0()

Skip 0 degrees from this tuple.

skip1back to summary
public final Tuple1<T2> skip1()

Skip 1 degrees from this tuple.

skip2back to summary
public final Tuple0 skip2()

Skip 2 degrees from this tuple.

split0back to summary
public final Tuple2<Tuple0, Tuple2<T1, T2>> split0()

Split this tuple into two tuples of degree 0 and 2.

split1back to summary
public final Tuple2<Tuple1<T1>, Tuple1<T2>> split1()

Split this tuple into two tuples of degree 1 and 1.

split2back to summary
public final Tuple2<Tuple2<T1, T2>, Tuple0> split2()

Split this tuple into two tuples of degree 2 and 0.

swapback to summary
public final Tuple2<T2, T1> swap()

Get a tuple with the two attributes swapped.

toArrayback to summary
public final Object[] toArray()

Implements org.jooq.lambda.tuple.Tuple.toArray.

Doc from org.jooq.lambda.tuple.Tuple.toArray.

Get an array representation of this tuple.

Annotations
@Override
toListback to summary
public final List<?> toList()

Implements org.jooq.lambda.tuple.Tuple.toList.

Doc from org.jooq.lambda.tuple.Tuple.toList.

Get a list representation of this tuple.

Annotations
@Override
toMapback to summary
public final Map<String, ?> toMap()

Implements org.jooq.lambda.tuple.Tuple.toMap.

Doc from org.jooq.lambda.tuple.Tuple.toMap.

Get a map representation of this tuple.

Annotations
@Override
toMapback to summary
public final <K> Map<K, ?> toMap(Function<? super Integer, ? extends K> keyMapper)

Implements org.jooq.lambda.tuple.Tuple.toMap.

Doc from org.jooq.lambda.tuple.Tuple.toMap.

Get a map representation of this tuple.

Annotations
@Override
toMapback to summary
public final <K> Map<K, ?> toMap(Supplier<? extends K> keySupplier1, Supplier<? extends K> keySupplier2)
toMapback to summary
public final <K> Map<K, ?> toMap(K key1, K key2)
toSeqback to summary
public final Seq<?> toSeq()

Implements org.jooq.lambda.tuple.Tuple.toSeq.

Doc from org.jooq.lambda.tuple.Tuple.toSeq.

Get a Seq representation of this tuple.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
v1back to summary
public T1 v1()
v2back to summary
public T2 v2()