@NotThreadSafe public static class RefreshableTask.Builder<T> extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Callable<T> |
refreshCallable |
private SdkPredicate<T> |
shouldDoAsyncRefresh |
private SdkPredicate<T> |
shouldDoBlockingRefresh |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
RefreshableTask<T> |
build() |
RefreshableTask.Builder |
withAsyncRefreshPredicate(SdkPredicate<T> shouldDoAsyncRefresh)
Set the predicate that will determine when the task will queue a non-blocking, async
refresh.
|
RefreshableTask.Builder |
withBlockingRefreshPredicate(SdkPredicate<T> shouldDoBlockingRefresh)
Set the predicate that will determine when the task will do a blocking refresh.
|
RefreshableTask.Builder |
withRefreshCallable(java.util.concurrent.Callable<T> refreshCallable)
Set the callable that will provide the value when a refresh occurs.
|
private java.util.concurrent.Callable<T> refreshCallable
private SdkPredicate<T> shouldDoBlockingRefresh
private SdkPredicate<T> shouldDoAsyncRefresh
public RefreshableTask.Builder withRefreshCallable(java.util.concurrent.Callable<T> refreshCallable)
public RefreshableTask.Builder withBlockingRefreshPredicate(SdkPredicate<T> shouldDoBlockingRefresh)
public RefreshableTask.Builder withAsyncRefreshPredicate(SdkPredicate<T> shouldDoAsyncRefresh)
public RefreshableTask<T> build()