Class RefreshResult.Builder<T>
- java.lang.Object
-
- software.amazon.awssdk.utils.cache.RefreshResult.Builder<T>
-
- All Implemented Interfaces:
Buildable
,CopyableBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
,SdkBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
- Enclosing class:
- RefreshResult<T>
public static final class RefreshResult.Builder<T> extends Object implements CopyableBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
A builder for aRefreshResult
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RefreshResult<T>
build()
Build aRefreshResult
using the values currently configured in this builder.RefreshResult.Builder<T>
prefetchTime(Instant prefetchTime)
Specify the time at which a thread that callsCachedSupplier.get()
should trigger a cache prefetch.RefreshResult.Builder<T>
staleTime(Instant staleTime)
Specify the time at which the value in this cache is stale, and all calls toCachedSupplier.get()
should block to try to update the value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
-
-
-
Method Detail
-
staleTime
public RefreshResult.Builder<T> staleTime(Instant staleTime)
Specify the time at which the value in this cache is stale, and all calls toCachedSupplier.get()
should block to try to update the value. If this isn't specified, all threads will never block to update the value.
-
prefetchTime
public RefreshResult.Builder<T> prefetchTime(Instant prefetchTime)
Specify the time at which a thread that callsCachedSupplier.get()
should trigger a cache prefetch. The exact behavior of a "prefetch" is defined when the cache is created withCachedSupplier.Builder.prefetchStrategy(CachedSupplier.PrefetchStrategy)
, and may either have one thread block to refresh the cache or have an asynchronous task reload the value in the background. If this isn't specified, the prefetch strategy will never be used and all threads will block to update the value when thestaleTime(Instant)
arrives.
-
build
public RefreshResult<T> build()
Build aRefreshResult
using the values currently configured in this builder.- Specified by:
build
in interfaceBuildable
- Specified by:
build
in interfaceSdkBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
- Returns:
- an instance of T
-
-