Interface ExpirationManager<T>

Type Parameters:
T - the type of value that this expiration manager holds
All Known Implementing Classes:
BaseExpiration, DailyExpiration, DayAndHourExpiration, ExpirationManager.StaticExpiration, HourlyExpiration

@InternalUseOnly public interface ExpirationManager<T>
Manage a value that changes after a certain period of time.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Static value - does not expire.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(long now)
    Get the value of this ExpirationManager for the given time.
    default T
    initialize(long now)
    The value for the given time, assuming it is the first access.
  • Method Details

    • get

      T get(long now)
      Get the value of this ExpirationManager for the given time. It is assumed that times passed in will be monotonically increasing.
      Parameters:
      now - the result of System.currentTimeInMillis.
      Returns:
      the value corresponding to the given time
    • initialize

      default T initialize(long now)
      The value for the given time, assuming it is the first access. Certain implementations generate different values for the initialized time vs. after an expiration.
      Parameters:
      now - the result of System.currentTimeInMillis.
      Returns:
      the value corresponding to the given initialization time