Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.net.vcn.VcnConfig.Builder

This class is used to incrementally build VcnConfig objects.

Summary

Public constructors
Builder(context: Context)

Public methods
VcnConfig.Builder

Adds a configuration for an individual gateway connection.

VcnConfig

Builds and validates the VcnConfig.

VcnConfig.Builder

Sets transports that will be restricted by the VCN.

Public constructors

Builder

Added in API level 31
Builder(context: Context)
Parameters
context Context: This value cannot be null.

Public methods

addGatewayConnectionConfig

Added in API level 31
fun addGatewayConnectionConfig(gatewayConnectionConfig: VcnGatewayConnectionConfig): VcnConfig.Builder

Adds a configuration for an individual gateway connection.

Parameters
gatewayConnectionConfig VcnGatewayConnectionConfig: the configuration for an individual gateway connection This value cannot be null.
Return
VcnConfig.Builder this Builder instance, for chaining This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if a VcnGatewayConnectionConfig has already been set for this VcnConfig with the same GatewayConnection name (as returned via android.net.vcn.VcnGatewayConnectionConfig#getGatewayConnectionName()).

build

Added in API level 31
fun build(): VcnConfig

Builds and validates the VcnConfig.

Return
VcnConfig an immutable VcnConfig instance This value cannot be null.

setRestrictedUnderlyingNetworkTransports

Added in API level 34
fun setRestrictedUnderlyingNetworkTransports(transports: MutableSet<Int!>): VcnConfig.Builder

Sets transports that will be restricted by the VCN.

In general, apps will not be able to bind to, or use a restricted network. In other words, unless the network type is marked restricted, any app can opt to use underlying networks, instead of through the VCN.

Parameters
transports MutableSet<Int!>: transports that will be restricted by VCN. Networks that include any of the transports will be marked as restricted. android.net.NetworkCapabilities#TRANSPORT_WIFI is marked restricted by default. This value cannot be null.
Return
VcnConfig.Builder this Builder instance, for chaining This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the input contains unsupported transport types.