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 theSupplier
underlying aCachedSupplier
. The underlyingSupplier
returns this to specify when the underlying value should be refreshed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RefreshResult.Builder<T>
A builder for aRefreshResult
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> RefreshResult.Builder<T>
builder(T value)
Get a builder for creating aRefreshResult
.Instant
prefetchTime()
When the configured value is getting close to stale and should be updated using the supplier'sCachedSupplier.prefetchStrategy
.Instant
staleTime()
When the configured value is stale and should no longer be used.RefreshResult.Builder<T>
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.T
value()
The value resulting from the refresh.-
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.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
builder
public static <T> RefreshResult.Builder<T> builder(T value)
Get a builder for creating aRefreshResult
.- 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'sCachedSupplier.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 interfaceToCopyableBuilder<RefreshResult.Builder<T>,RefreshResult<T>>
- Returns:
- a builder for type T
-
-