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:
Serializable
,Comparable<LongObjTuple2<T>>
,Iterable<Object>
public class LongObjTuple2<T> extends Object implements Iterable<Object>, Serializable, Comparable<LongObjTuple2<T>>
Copy of Reactor's Tuple2 but accepting a long as the first object.- See Also:
of(long, Object)
,Tuple2
, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(LongObjTuple2<T> o)
static <T> reactor.util.function.Tuple2<Long,T>
convert(LongObjTuple2<T> tuple)
Converts aLongObjTuple2
to aTuple2
.boolean
equals(Object o)
static <T> LongObjTuple2<T>
from(reactor.util.function.Tuple2<Long,T> tuple2)
Converts aTuple2
to aLongObjTuple2
.Object
get(int index)
Get the object at the given index.long
getT1()
Type-safe way to get the fist object of thisTuples
.T
getT2()
Type-safe way to get the second object of thisTuples
.int
hashCode()
Iterator<Object>
iterator()
static <T> LongObjTuple2<T>
of(long t1, T t2)
Create aLongObjTuple2
with the given objects.int
size()
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.String
toString()
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 aLongObjTuple2
with 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(reactor.util.function.Tuple2<Long,T> tuple2)
Converts aTuple2
to aLongObjTuple2
.- Type Parameters:
T
- The type of the second value.- Parameters:
tuple2
- TheTuple2
to convert.- Returns:
- The new converted
LongObjTuple2
.
-
convert
public static <T> reactor.util.function.Tuple2<Long,T> convert(LongObjTuple2<T> tuple)
Converts aLongObjTuple2
to aTuple2
.- Type Parameters:
T
- The type of the second value.- Parameters:
tuple
- TheLongObjTuple2
to 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:
compareTo
in interfaceComparable<T>
-
-