Class TimeProviderBase

java.lang.Object
com.sportradar.livedata.sdk.common.timer.TimeProviderBase
Direct Known Subclasses:
RealTimeTimeProvider, TimeProvider

public abstract class TimeProviderBase extends Object
  • Field Details

  • Constructor Details

    • TimeProviderBase

      public TimeProviderBase()
  • Method Details

    • getCurrent

      public static TimeProviderBase getCurrent()
      Gets the currently used TimeProviderBase instance.
      Returns:
      The currently used TimeProviderBase instance.
    • getDateTime

      public abstract org.joda.time.DateTime getDateTime()
      When overridden in derived class, gets the DateTime specifying the current date and time.
      Returns:
      the DateTime specifying the current date and time.
    • getCurrentTime

      public org.joda.time.DateTime getCurrentTime()
    • getDate

      public abstract Date getDate()
      When overridden in derived class, gets the Date specifying the current date and time.
      Returns:
      The Date specifying the current date and time.
    • setCurrent

      public static void setCurrent(TimeProviderBase provider)
      Sets the currently used TimeProviderBase instance.
      Parameters:
      provider - The TimeProviderBase to be used.
      Throws:
      IllegalArgumentException - The provider is a null reference.
    • resetToRealTime

      public static void resetToRealTime()
      Sets the currently used TimeProviderBase to default one which uses system time.
    • getFutureDate

      public Date getFutureDate(long millis)
      Adds millis to current date
      Parameters:
      millis - milliseconds to add to current date
      Returns:
      The Date specifying future date and time