Package discord4j.store.api.util
Class LongLongTuple2
- java.lang.Object
-
- discord4j.store.api.util.LongLongTuple2
-
- All Implemented Interfaces:
Comparable<LongLongTuple2>,Iterable<Long>
public class LongLongTuple2 extends Object implements Iterable<Long>, Comparable<LongLongTuple2>
Copy of Reactor's Tuple2 but accepting two longs.- See Also:
of(long, long),Tuple2
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(LongLongTuple2 o)static Tuple2<Long,Long>convert(LongLongTuple2 tuple)Converts aLongLongTuple2to aTuple2.booleanequals(Object o)static LongLongTuple2from(Tuple2<Long,Long> tuple2)Converts aTuple2to aLongLongTuple2.longget(int index)Get the object at the given index.longgetT1()Type-safe way to get the fist object of thisTuples.longgetT2()Type-safe way to get the second object of thisTuples.inthashCode()Iterator<Long>iterator()static LongLongTuple2of(long t1, long t2)Create aLongLongTuple2with the given objects.intsize()Return the number of elements in this Tuples.long[]toArray()Turn this Tuples into a plain Object array.List<Long>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 LongLongTuple2 of(long t1, long t2)
Create aLongLongTuple2with the given objects.- Parameters:
t1- The first value in the tuple. Not null.t2- The second value in the tuple. Not null.- Returns:
- The new
LongLongTuple2.
-
from
public static LongLongTuple2 from(Tuple2<Long,Long> tuple2)
Converts aTuple2to aLongLongTuple2.- Parameters:
tuple2- TheTuple2to convert.- Returns:
- The new converted
LongLongTuple2.
-
convert
public static Tuple2<Long,Long> convert(LongLongTuple2 tuple)
Converts aLongLongTuple2to aTuple2.- Parameters:
tuple- TheLongLongTuple2to 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 long getT2()
Type-safe way to get the second object of thisTuples.- Returns:
- The second object
-
get
public long 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 throws
IndexOutOfBoundsExceptionif out of bounds. - Throws:
IndexOutOfBoundsException- if the index is out of range.
-
toList
public List<Long> toList()
Turn this Tuples into a plain Object list.- Returns:
- A new Object list.
-
toArray
public long[] 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(LongLongTuple2 o)
- Specified by:
compareToin interfaceComparable<LongLongTuple2>
-
-