Class RefreshResult<T>

java.lang.Object
software.amazon.awssdk.utils.cache.RefreshResult<T>
All Implemented Interfaces:
ToCopyableBuilder<RefreshResult.Builder<T>,RefreshResult<T>>

public final class RefreshResult<T> extends Object implements ToCopyableBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
A wrapper for the value returned by the Supplier underlying a CachedSupplier. The underlying Supplier returns this to specify when the underlying value should be refreshed.
  • Method Details

    • builder

      public static <T> RefreshResult.Builder<T> builder(T value)
      Get a builder for creating a RefreshResult.
      Parameters:
      value - The value that should be cached by the supplier.
    • value

      public T value()
      The value resulting from the refresh.
    • staleTime

      public Instant staleTime()
      When the configured value is stale and should no longer be used. All threads will block until the value is updated.
    • prefetchTime

      public Instant prefetchTime()
      When the configured value is getting close to stale and should be updated using the supplier's CachedSupplier.prefetchStrategy.
    • toBuilder

      public RefreshResult.Builder<T> toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
      Returns:
      a builder for type T