Package org.chsrobotics.lib.util
Class Tuple2<T>
java.lang.Object
org.chsrobotics.lib.util.Tuple2<T>
- Type Parameters:
T
- The data type of objects to store.
Very simple utility class which can hold any two objects of the same type in order.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the first value of the tuple.static <U> Tuple2<U>
of
(U valueA, U valueB) Constructs and returns a Tuple2 of two values of the same data type.Returns the seond value of the tuple.toList()
Returns the data of this object as a list of two elements.toString()
-
Constructor Details
-
Tuple2
Constructs a Tuple2.- Parameters:
valueA
- First value of T.valueB
- Second value of T.
-
-
Method Details
-
toList
Returns the data of this object as a list of two elements.- Returns:
- A list, containing two values, of the contents of this instance.
-
firstValue
Returns the first value of the tuple.- Returns:
- An instance of T.
-
secondValue
Returns the seond value of the tuple.- Returns:
- An instance of T.
-
of
Constructs and returns a Tuple2 of two values of the same data type.- Type Parameters:
U
- The data type of the values.- Parameters:
valueA
- The first instance of U.valueB
- The first instance of U.- Returns:
- A Tuple2 of the two values.
-
toString
-