SpeculativeLoadingConfig.Builder
@Profile.ExperimentalUrlPrefetch
public final class SpeculativeLoadingConfig.Builder
Summary
Public constructors |
|---|
Builder() |
Public methods |
|
|---|---|
@NonNull SpeculativeLoadingConfig |
Builds a new |
@NonNull SpeculativeLoadingConfig.Builder |
setMaxPrefetches(@IntRange(from = 1) int max)Sets the maximum number of allowed prefetches. |
@NonNull SpeculativeLoadingConfig.Builder |
setMaxPrerenders(@IntRange(from = 1) int max)Sets the maximum number of allowed prerenders. |
@NonNull SpeculativeLoadingConfig.Builder |
setPrefetchTtlSeconds(@IntRange(from = 1) int ttlSeconds)Sets the Time-to-Live (TTL) in seconds for prefetched data. |
Public methods
build
@Profile.ExperimentalUrlPrefetch
public @NonNull SpeculativeLoadingConfig build()
Builds a new SpeculativeLoadingConfig instance.
This method creates a new SpeculativeLoadingConfig object using the parameters that have been set in this builder.
| Returns | |
|---|---|
@NonNull SpeculativeLoadingConfig |
A new |
setMaxPrefetches
public @NonNull SpeculativeLoadingConfig.Builder setMaxPrefetches(@IntRange(from = 1) int max)
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 | |
|---|---|
@IntRange(from = 1) int max |
The maximum number of prefetches. Must be a positive integer. |
| Returns | |
|---|---|
@NonNull SpeculativeLoadingConfig.Builder |
This builder instance for method chaining. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
build |
setMaxPrerenders
public @NonNull SpeculativeLoadingConfig.Builder setMaxPrerenders(@IntRange(from = 1) int max)
Sets the maximum number of allowed prerenders. The WebView's internal maximum limit may override this value.
| Parameters | |
|---|---|
@IntRange(from = 1) int max |
The maximum number of prerenders. Must be a positive integer. |
| Returns | |
|---|---|
@NonNull SpeculativeLoadingConfig.Builder |
This builder instance for method chaining. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
build |
setPrefetchTtlSeconds
public @NonNull SpeculativeLoadingConfig.Builder setPrefetchTtlSeconds(@IntRange(from = 1) int ttlSeconds)
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 | |
|---|---|
@IntRange(from = 1) int ttlSeconds |
The TTL value in seconds. Must be a positive integer. |
| Returns | |
|---|---|
@NonNull SpeculativeLoadingConfig.Builder |
This builder instance for method chaining. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
build |