TYPE - the configurable object type.public static final class LoaderConfiguration.Builder<TYPE> extends Object
| Constructor and Description |
|---|
LoaderConfiguration.Builder(LoaderConfiguration.Configurable<? extends TYPE> configurable)
Constructor.
|
LoaderConfiguration.Builder(LoaderConfiguration.Configurable<? extends TYPE> configurable,
LoaderConfiguration initialConfiguration)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TYPE |
set()
Sets the configuration and returns the configurable object.
|
LoaderConfiguration.Builder<TYPE> |
with(LoaderConfiguration configuration)
Applies the specified configuration to this builder.
|
LoaderConfiguration.Builder<TYPE> |
withCacheStrategy(LoaderConfiguration.CacheStrategyType strategyType)
Tells the builder how to cache the invocation result after its completion.
|
LoaderConfiguration.Builder<TYPE> |
withClashResolution(LoaderConfiguration.ClashResolutionType resolutionType)
Tells the builder how to resolve clashes of invocations with different inputs.
|
LoaderConfiguration.Builder<TYPE> |
withId(int loaderId)
Tells the builder to identify the loader with the specified ID.
|
LoaderConfiguration.Builder<TYPE> |
withInputClashResolution(LoaderConfiguration.ClashResolutionType resolutionType)
Tells the builder how to resolve clashes of invocations with same inputs.
|
LoaderConfiguration.Builder<TYPE> |
withResultLooper(Looper looper)
Sets the looper on which the results from the loader are dispatched.
|
LoaderConfiguration.Builder<TYPE> |
withResultStaleTime(long time,
TimeUnit timeUnit)
Sets the time after which results are considered to be stale.
|
LoaderConfiguration.Builder<TYPE> |
withResultStaleTime(TimeDuration staleTime)
Sets the time after which results are considered to be stale.
|
public LoaderConfiguration.Builder(@Nonnull LoaderConfiguration.Configurable<? extends TYPE> configurable)
configurable - the configurable instance.public LoaderConfiguration.Builder(@Nonnull LoaderConfiguration.Configurable<? extends TYPE> configurable, @Nonnull LoaderConfiguration initialConfiguration)
initialConfiguration - the initial loader configuration.@Nonnull public TYPE set()
@Nonnull public LoaderConfiguration.Builder<TYPE> with(@Nullable LoaderConfiguration configuration)
configuration - the loader configuration.@Nonnull public LoaderConfiguration.Builder<TYPE> withCacheStrategy(@Nullable LoaderConfiguration.CacheStrategyType strategyType)
strategyType - the cache strategy type.@Nonnull public LoaderConfiguration.Builder<TYPE> withClashResolution(@Nullable LoaderConfiguration.ClashResolutionType resolutionType)
resolutionType - the type of resolution.@Nonnull public LoaderConfiguration.Builder<TYPE> withId(int loaderId)
loaderId - the loader ID.@Nonnull public LoaderConfiguration.Builder<TYPE> withInputClashResolution(@Nullable LoaderConfiguration.ClashResolutionType resolutionType)
resolutionType - the type of resolution.@Nonnull public LoaderConfiguration.Builder<TYPE> withResultLooper(@Nullable Looper looper)
looper - the looper instance.@Nonnull public LoaderConfiguration.Builder<TYPE> withResultStaleTime(@Nullable TimeDuration staleTime)
staleTime - the stale time.@Nonnull public LoaderConfiguration.Builder<TYPE> withResultStaleTime(long time, @Nonnull TimeUnit timeUnit)
time - the time.timeUnit - the time unit.IllegalArgumentException - if the specified timeout is negative.