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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this Tuple2 object with the specified object for equality.first()Returns the value of thefirstrecord component.final inthashCode()Returns a hash code value for this object.second()Returns the value of thesecondrecord component.final StringtoString()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 thefirstrecord component.- Returns:
- the value of the
firstrecord component
-
second
Returns the value of thesecondrecord component.- Returns:
- the value of the
secondrecord component
-