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 boolean
Indicates whether some other object is "equal to" this one.first()
Returns the value of thefirst
record component.final int
hashCode()
Returns a hash code value for this object.static <T,
U> Tuple2 <T, U> of
(T first, U second) Returns aTuple2
consisting of the specified components.second()
Returns the value of thesecond
record component.toEntry()
Converts this instance to an immutableMap
entry.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Tuple2
-
-
Method Details
-
of
Returns aTuple2
consisting 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
Tuple2
instance 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
-