Class Pair<U,V>
java.lang.Object
cloud.commandframework.types.tuples.Pair<U,V>
- Type Parameters:
U- First typeV- Second type
- All Implemented Interfaces:
Tuple
Immutable generic 2-tuple
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal UgetFirst()Get the first valuefinal VGet the second valuefinal intgetSize()Get the tuple sizefinal inthashCode()static <U,V> @NonNull Pair<U, V> of(U first, V second) Create a new 2-tuplefinal @NonNull Object @NonNull []toArray()Turn the tuple into a type erased arrayfinal StringtoString()
-
Constructor Details
-
Pair
-
-
Method Details
-
of
Create a new 2-tuple- Type Parameters:
U- First typeV- Second type- Parameters:
first- First valuesecond- Second value- Returns:
- Created pair
-
getFirst
Get the first value- Returns:
- First value
-
getSecond
Get the second value- Returns:
- Second value
-
equals
-
hashCode
public final int hashCode() -
toString
-
getSize
public final int getSize()Description copied from interface:TupleGet the tuple size -
toArray
Description copied from interface:TupleTurn the tuple into a type erased array
-