SpeculativeLoadingConfig.Builder
@Profile.ExperimentalUrlPrefetch
class SpeculativeLoadingConfig.Builder
Summary
Public constructors |
|---|
Builder() |
Public functions |
|
|---|---|
SpeculativeLoadingConfig |
Builds a new |
SpeculativeLoadingConfig.Builder |
setMaxPrefetches(max: @IntRange(from = 1) Int)Sets the maximum number of allowed prefetches. |
SpeculativeLoadingConfig.Builder |
setMaxPrerenders(max: @IntRange(from = 1) Int)Sets the maximum number of allowed prerenders. |
SpeculativeLoadingConfig.Builder |
setPrefetchTtlSeconds(ttlSeconds: @IntRange(from = 1) Int)Sets the Time-to-Live (TTL) in seconds for prefetched data. |
Public functions
build
@Profile.ExperimentalUrlPrefetch
fun build(): SpeculativeLoadingConfig
Builds a new SpeculativeLoadingConfig instance.
This method creates a new SpeculativeLoadingConfig object using the parameters that have been set in this builder.
| Returns | |
|---|---|
SpeculativeLoadingConfig |
A new |
setMaxPrefetches
fun setMaxPrefetches(max: @IntRange(from = 1) Int): SpeculativeLoadingConfig.Builder
Sets the maximum number of allowed prefetches. This value limits the number of prefetch data that can live in the cache. The WebView's internal maximum limit may override this value.
| Parameters | |
|---|---|
max: @IntRange(from = 1) Int |
The maximum number of prefetches. Must be a positive integer. |
| Returns | |
|---|---|
SpeculativeLoadingConfig.Builder |
This builder instance for method chaining. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
build |
setMaxPrerenders
fun setMaxPrerenders(max: @IntRange(from = 1) Int): SpeculativeLoadingConfig.Builder
Sets the maximum number of allowed prerenders. The WebView's internal maximum limit may override this value.
| Parameters | |
|---|---|
max: @IntRange(from = 1) Int |
The maximum number of prerenders. Must be a positive integer. |
| Returns | |
|---|---|
SpeculativeLoadingConfig.Builder |
This builder instance for method chaining. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
build |
setPrefetchTtlSeconds
fun setPrefetchTtlSeconds(ttlSeconds: @IntRange(from = 1) Int): SpeculativeLoadingConfig.Builder
Sets the Time-to-Live (TTL) in seconds for prefetched data.
This value determines how long prefetched data will be considered valid before it is refreshed.
| Parameters | |
|---|---|
ttlSeconds: @IntRange(from = 1) Int |
The TTL value in seconds. Must be a positive integer. |
| Returns | |
|---|---|
SpeculativeLoadingConfig.Builder |
This builder instance for method chaining. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
build |