Record Class Tuple2<T,U>
java.lang.Object
java.lang.Record
org.klojang.util.Tuple2<T,U>
- Type Parameters:
T- The type of the first componentU- The type of the second component- Record Components:
first- The first component of the 2-tuplesecond- The second component of the 2-tuple
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.first()Returns the value of thefirstrecord component.final inthashCode()Returns a hash code value for this object.static <T,U> Tuple2 <T, U> of(T first, U second) Returns aTuple2consisting of the specified components.second()Returns the value of thesecondrecord component.toEntry()Converts this instance to an immutableMapentry.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Tuple2
-
-
Method Details
-
of
Returns aTuple2consisting of the specified components.- Type Parameters:
T- The type of the first componentU- The type of the second component- Parameters:
first- The first component of the 2-tuplesecond- The second component of the 2-tuple- Returns:
- A
Tuple2instance containing the specified values
-
toEntry
-
toString
-
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). -
first
-
second
-