Package mastermind.utils
Record Class Tuple2<T,U>
java.lang.Object
java.lang.Record
mastermind.utils.Tuple2<T,U>
- Type Parameters:
T
- the type of the first elementU
- the type of the second element- Record Components:
first
- the first elementsecond
- the second element
Represents a tuple of two elements.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this Tuple2 object with the specified object for equality.first()
Returns the value of thefirst
record component.final int
hashCode()
Returns a hash code value for this object.second()
Returns the value of thesecond
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
equals
Compares this Tuple2 object with the specified object for equality. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
first
Returns the value of thefirst
record component.- Returns:
- the value of the
first
record component
-
second
Returns the value of thesecond
record component.- Returns:
- the value of the
second
record component
-