Record Class Tuple<L,R>
java.lang.Object
java.lang.Record
nl.colorize.util.Tuple<L,R>
- Type Parameters:
L- Type of the first (left) element.R- Type of the second (right) element.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true ifelementis one of this tuple's elements.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.inverse()Returns a new tuple with the inverse of this tuple's elements.left()Returns the value of theleftrecord component.<L2,R2> Tuple <L2, R2> static <L,R> Tuple <L, R> of(L left, R right) Convenience factory method to create a tuple without having to specify the generic types.right()Returns the value of therightrecord component.toString()Returns the string representation of this tuple.
-
Constructor Details
-
Tuple
-
-
Method Details
-
contains
Returns true ifelementis one of this tuple's elements. -
inverse
-
map
-
toString
-
of
Convenience factory method to create a tuple without having to specify the generic types. -
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-