Package io.reactivex.rxjava3.schedulers
Class Timed<T>
- java.lang.Object
-
- io.reactivex.rxjava3.schedulers.Timed<T>
-
- Type Parameters:
T
- the value type
public final class Timed<T> extends java.lang.Object
Holds onto a value along with time information.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
int
hashCode()
long
time()
Returns the time value.long
time(@NonNull java.util.concurrent.TimeUnit unit)
Returns the contained time value in the time unit specified.java.lang.String
toString()
@NonNull java.util.concurrent.TimeUnit
unit()
Returns the time unit of the contained time.T
value()
Returns the contained value.
-
-
-
Field Detail
-
value
final T value
-
time
final long time
-
unit
final java.util.concurrent.TimeUnit unit
-
-
Constructor Detail
-
Timed
public Timed(@NonNull T value, long time, @NonNull @NonNull java.util.concurrent.TimeUnit unit)
Constructs aTimed
instance with the given value and time information.- Parameters:
value
- the value to holdtime
- the time to holdunit
- the time unit, not null- Throws:
java.lang.NullPointerException
- ifvalue
orunit
isnull
-
-
Method Detail
-
unit
@NonNull public @NonNull java.util.concurrent.TimeUnit unit()
Returns the time unit of the contained time.- Returns:
- the time unit of the contained time
-
time
public long time()
Returns the time value.- Returns:
- the time value
-
time
public long time(@NonNull @NonNull java.util.concurrent.TimeUnit unit)
Returns the contained time value in the time unit specified.- Parameters:
unit
- the time unit- Returns:
- the converted time
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-