Top Description Fields Constructors Methods
io.vavr

public final Class Tuple0

extends Object
implements Tuple, Comparable<Tuple0>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Comparable, io.vavr.Tuple
Imports
io.vavr.collection.List, .Seq, java.io.Serializable, java.util.Comparator, .Objects, java.util.function.Supplier

A tuple of no elements which can be seen as cartesian product of no components.
Author
Daniel Dietrich

Field Summary

Modifier and TypeField and Description
private static final Comparator<Tuple0>
COMPARATOR

The singleton Tuple0 comparator.

private static final Tuple0
INSTANCE

The singleton instance of Tuple0.

private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public <
type of the value to append
T1
>
Tuple1<T1>

Returns:

a new Tuple with the value appended
append
(T1
the value to append
t1
)

Append a value to this tuple.

public <
type of the transformation result
U
>
U

Returns:

An object of type U
apply
(Supplier<? extends U>
Transformation which creates a new object of type U based on this tuple's contents.
f
)

Transforms this tuple to an object of type U.

public int
arity()

Implements io.vavr.Tuple.arity.

Returns the number of elements of this tuple.

public static Comparator<Tuple0>
public int
compareTo(Tuple0
the object to be compared.
that
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public <
the type of the 1st value in the tuple
T1
>
Tuple1<T1>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple1<T1>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
>
Tuple2<T1, T2>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple2<T1, T2>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
,
the type of the 3rd value in the tuple
T3
>
Tuple3<T1, T2, T3>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple3<T1, T2, T3>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
,
the type of the 3rd value in the tuple
T3
,
the type of the 4th value in the tuple
T4
>
Tuple4<T1, T2, T3, T4>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple4<T1, T2, T3, T4>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
,
the type of the 3rd value in the tuple
T3
,
the type of the 4th value in the tuple
T4
,
the type of the 5th value in the tuple
T5
>
Tuple5<T1, T2, T3, T4, T5>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple5<T1, T2, T3, T4, T5>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
,
the type of the 3rd value in the tuple
T3
,
the type of the 4th value in the tuple
T4
,
the type of the 5th value in the tuple
T5
,
the type of the 6th value in the tuple
T6
>
Tuple6<T1, T2, T3, T4, T5, T6>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple6<T1, T2, T3, T4, T5, T6>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
,
the type of the 3rd value in the tuple
T3
,
the type of the 4th value in the tuple
T4
,
the type of the 5th value in the tuple
T5
,
the type of the 6th value in the tuple
T6
,
the type of the 7th value in the tuple
T7
>
Tuple7<T1, T2, T3, T4, T5, T6, T7>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple7<T1, T2, T3, T4, T5, T6, T7>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public <
the type of the 1st value in the tuple
T1
,
the type of the 2nd value in the tuple
T2
,
the type of the 3rd value in the tuple
T3
,
the type of the 4th value in the tuple
T4
,
the type of the 5th value in the tuple
T5
,
the type of the 6th value in the tuple
T6
,
the type of the 7th value in the tuple
T7
,
the type of the 8th value in the tuple
T8
>
Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>

Returns:

a new Tuple with the tuple values appended
concat
(Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>
the tuple to concat
tuple
)

Concat a tuple's values to this tuple.

public boolean
equals(Object
the reference object with which to compare.
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 Tuple0

Returns:

The singleton instance of Tuple0.
instance
()

Returns the singleton instance of Tuple0.

private Object

Returns:

The singleton instance of Tuple0.
readResolve
()

Instance control for object serialization.

public Seq<?>
toSeq()

Implements io.vavr.Tuple.toSeq.

Converts this tuple to a sequence.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

COMPARATORback to summary
private static final Comparator<Tuple0> COMPARATOR

The singleton Tuple0 comparator.

INSTANCEback to summary
private static final Tuple0 INSTANCE

The singleton instance of Tuple0.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.vavr.Tuple.serialVersionUID.

Constructor Detail

Tuple0back to summary
private Tuple0()

Method Detail

appendback to summary
public <T1> Tuple1<T1> append(T1 t1)

Append a value to this tuple.

Parameters
<T1>
type of the value to append
t1:T1

the value to append

Returns:Tuple1<T1>

a new Tuple with the value appended

applyback to summary
public <U> U apply(Supplier<? extends U> f)

Transforms this tuple to an object of type U.

Parameters
<U>
type of the transformation result
f:Supplier<? extends U>

Transformation which creates a new object of type U based on this tuple's contents.

Returns:U

An object of type U

Exceptions
NullPointerException:
if f is null
arityback to summary
public int arity()

Implements io.vavr.Tuple.arity.

Doc from io.vavr.Tuple.arity.

Returns the number of elements of this tuple.

Returns:int

the number of elements.

Annotations
@Override
comparatorback to summary
public static Comparator<Tuple0> comparator()
compareToback to summary
public int compareTo(Tuple0 that)

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.

Parameters
that:Tuple0

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
concatback to summary
public <T1> Tuple1<T1> concat(Tuple1<T1> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
tuple:Tuple1<T1>

the tuple to concat

Returns:Tuple1<T1>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2> Tuple2<T1, T2> concat(Tuple2<T1, T2> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
tuple:Tuple2<T1, T2>

the tuple to concat

Returns:Tuple2<T1, T2>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2, T3> Tuple3<T1, T2, T3> concat(Tuple3<T1, T2, T3> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
<T3>
the type of the 3rd value in the tuple
tuple:Tuple3<T1, T2, T3>

the tuple to concat

Returns:Tuple3<T1, T2, T3>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2, T3, T4> Tuple4<T1, T2, T3, T4> concat(Tuple4<T1, T2, T3, T4> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
<T3>
the type of the 3rd value in the tuple
<T4>
the type of the 4th value in the tuple
tuple:Tuple4<T1, T2, T3, T4>

the tuple to concat

Returns:Tuple4<T1, T2, T3, T4>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2, T3, T4, T5> Tuple5<T1, T2, T3, T4, T5> concat(Tuple5<T1, T2, T3, T4, T5> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
<T3>
the type of the 3rd value in the tuple
<T4>
the type of the 4th value in the tuple
<T5>
the type of the 5th value in the tuple
tuple:Tuple5<T1, T2, T3, T4, T5>

the tuple to concat

Returns:Tuple5<T1, T2, T3, T4, T5>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2, T3, T4, T5, T6> Tuple6<T1, T2, T3, T4, T5, T6> concat(Tuple6<T1, T2, T3, T4, T5, T6> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
<T3>
the type of the 3rd value in the tuple
<T4>
the type of the 4th value in the tuple
<T5>
the type of the 5th value in the tuple
<T6>
the type of the 6th value in the tuple
tuple:Tuple6<T1, T2, T3, T4, T5, T6>

the tuple to concat

Returns:Tuple6<T1, T2, T3, T4, T5, T6>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2, T3, T4, T5, T6, T7> Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple7<T1, T2, T3, T4, T5, T6, T7> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
<T3>
the type of the 3rd value in the tuple
<T4>
the type of the 4th value in the tuple
<T5>
the type of the 5th value in the tuple
<T6>
the type of the 6th value in the tuple
<T7>
the type of the 7th value in the tuple
tuple:Tuple7<T1, T2, T3, T4, T5, T6, T7>

the tuple to concat

Returns:Tuple7<T1, T2, T3, T4, T5, T6, T7>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
concatback to summary
public <T1, T2, T3, T4, T5, T6, T7, T8> Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> tuple)

Concat a tuple's values to this tuple.

Parameters
<T1>
the type of the 1st value in the tuple
<T2>
the type of the 2nd value in the tuple
<T3>
the type of the 3rd value in the tuple
<T4>
the type of the 4th value in the tuple
<T5>
the type of the 5th value in the tuple
<T6>
the type of the 6th value in the tuple
<T7>
the type of the 7th value in the tuple
<T8>
the type of the 8th value in the tuple
tuple:Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>

the tuple to concat

Returns:Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>

a new Tuple with the tuple values appended

Exceptions
NullPointerException:
if tuple is null
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.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

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.
Returns:int

a hash code value for this object

Annotations
@Override
instanceback to summary
public static Tuple0 instance()

Returns the singleton instance of Tuple0.

Returns:Tuple0

The singleton instance of Tuple0.

readResolveback to summary
private Object readResolve()

Instance control for object serialization.

Returns:Object

The singleton instance of Tuple0.

See Also
java.io.Serializable
toSeqback to summary
public Seq<?> toSeq()

Implements io.vavr.Tuple.toSeq.

Doc from io.vavr.Tuple.toSeq.

Converts this tuple to a sequence.

Returns:Seq<?>

A new Seq.

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.

Returns:String

a string representation of the object

Annotations
@Override