| Package | Description |
|---|---|
| org.sodeac.common.function |
| Modifier and Type | Method and Description |
|---|---|
static <T> SmartSupplier<T> |
SmartSupplier.forSupplier(Supplier<T> wrappedSupplier)
create smart supplier
|
SmartSupplier<T> |
SmartSupplier.useCacheAfterFailedAttemptsCount(int failedAttemptCount)
instruct to use cached value (if exists) after x times the wrapped supplier returns null-value
|
SmartSupplier<T> |
SmartSupplier.withAttemptCount(int attemptCount)
instruct smart supplier to retry
Supplier.get() multiple time, if wrapped supplier returns null-value |
SmartSupplier<T> |
SmartSupplier.withCacheExpireTime(int cacheExpireTimeValue,
TimeUnit cacheExpireTimeUnit)
define expire time for cached value
|
SmartSupplier<T> |
SmartSupplier.withDefaultValue(T defaultValue)
define default value, if supplier return no not-null-value
|
SmartSupplier<T> |
SmartSupplier.withWaitTimeForNextAttempt(int waitTimeValue,
TimeUnit waitTimeUnit)
define wait time for next retry - @see
withAttemptCount(int) |
Copyright © 2020. All rights reserved.