Package discord4j.store.api.util
Class LongObjTuple2<T>
- java.lang.Object
-
- discord4j.store.api.util.LongObjTuple2<T>
-
- Type Parameters:
T- The second object type.
- All Implemented Interfaces:
Comparable<LongObjTuple2<T>>,Iterable<Object>
public class LongObjTuple2<T> extends Object implements Iterable<Object>, Comparable<LongObjTuple2<T>>
Copy of Reactor's Tuple2 but accepting a long as the first object.- See Also:
of(long, Object),Tuple2
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(LongObjTuple2<T> o)static <T> Tuple2<Long,T>convert(LongObjTuple2<T> tuple)Converts aLongObjTuple2to aTuple2.booleanequals(Object o)static <T> LongObjTuple2<T>from(Tuple2<Long,T> tuple2)Converts aTuple2to aLongObjTuple2.Objectget(int index)Get the object at the given index.longgetT1()Type-safe way to get the fist object of thisTuples.TgetT2()Type-safe way to get the second object of thisTuples.inthashCode()Iterator<Object>iterator()static <T> LongObjTuple2<T>of(long t1, T t2)Create aLongObjTuple2with the given objects.intsize()Return the number of elements in this Tuples.Object[]toArray()Turn this Tuples into a plain Object array.List<Object>toList()Turn this Tuples into a plain Object list.StringtoString()A Tuple String representation is the comma separated list of values, enclosed in square brackets.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
of
public static <T> LongObjTuple2<T> of(long t1, T t2)
Create aLongObjTuple2with the given objects.- Type Parameters:
T- The type of the second value.- Parameters:
t1- The first value in the tuple. Not null.t2- The second value in the tuple. Not null.- Returns:
- The new
LongObjTuple2.
-
from
public static <T> LongObjTuple2<T> from(Tuple2<Long,T> tuple2)
Converts aTuple2to aLongObjTuple2.- Type Parameters:
T- The type of the second value.- Parameters:
tuple2- TheTuple2to convert.- Returns:
- The new converted
LongObjTuple2.
-
convert
public static <T> Tuple2<Long,T> convert(LongObjTuple2<T> tuple)
Converts aLongObjTuple2to aTuple2.- Type Parameters:
T- The type of the second value.- Parameters:
tuple- TheLongObjTuple2to convert.- Returns:
- The new converted
Tuple2.
-
getT1
public long getT1()
Type-safe way to get the fist object of thisTuples.- Returns:
- The first object
-
getT2
public T getT2()
Type-safe way to get the second object of thisTuples.- Returns:
- The second object
-
get
@Nullable public Object get(int index)
Get the object at the given index.- Parameters:
index- The index of the object to retrieve. Starts at 0.- Returns:
- The object or null if out of bounds.
-
toList
public List<Object> toList()
Turn this Tuples into a plain Object list.- Returns:
- A new Object list.
-
toArray
public Object[] toArray()
Turn this Tuples into a plain Object array.- Returns:
- A new Object array.
-
size
public int size()
Return the number of elements in this Tuples.- Returns:
- The size of this Tuples.
-
toString
public final String toString()
A Tuple String representation is the comma separated list of values, enclosed in square brackets.
-
compareTo
public int compareTo(LongObjTuple2<T> o)
- Specified by:
compareToin interfaceComparable<T>
-
-