Stay organized with collections Save and categorize content based on your preferences.

DnsOptions.Builder

public static final class DnsOptions.Builder
extends Object

java.lang.Object
   ↳ android.net.http.DnsOptions.Builder


Builder for DnsOptions.

Summary

Public constructors

Builder()

Public methods

DnsOptions build()

Creates and returns the final DnsOptions instance, based on the values in this builder.

DnsOptions.Builder setPersistHostCache(boolean persistHostCache)

Sets whether the DNS cache should be persisted to disk.

DnsOptions.Builder setPersistHostCachePeriod(Duration persistHostCachePeriod)

Sets the minimum period between subsequent writes to disk for DNS cache persistence.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public DnsOptions build ()

Creates and returns the final DnsOptions instance, based on the values in this builder.

Returns
DnsOptions

setPersistHostCache

public DnsOptions.Builder setPersistHostCache (boolean persistHostCache)

Sets whether the DNS cache should be persisted to disk.

Only relevant if HttpEngine.Builder#setStoragePath(String) is set.

Parameters
persistHostCache boolean

Returns
DnsOptions.Builder the builder for chaining

setPersistHostCachePeriod

public DnsOptions.Builder setPersistHostCachePeriod (Duration persistHostCachePeriod)

Sets the minimum period between subsequent writes to disk for DNS cache persistence.

Only relevant if setPersistHostCache(boolean) is set to true.

Parameters
persistHostCachePeriod Duration

Returns
DnsOptions.Builder the builder for chaining