Class Timed<T>

java.lang.Object
io.reactivex.rxjava3.schedulers.Timed<T>
Type Parameters:
T - the value type

public final class Timed<T> extends Object
Holds onto a value along with time information.
  • Field Details

    • value

      final T value
    • time

      final long time
    • unit

      final TimeUnit unit
  • Constructor Details

    • Timed

      public Timed(@NonNull T value, long time, @NonNull @NonNull TimeUnit unit)
      Constructs a Timed instance with the given value and time information.
      Parameters:
      value - the value to hold
      time - the time to hold
      unit - the time unit, not null
      Throws:
      NullPointerException - if value or unit is null
  • Method Details

    • value

      @NonNull public T value()
      Returns the contained value.
      Returns:
      the contained value
    • unit

      @NonNull public @NonNull 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 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(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object