Builder
class Builder
kotlin.Any | |
↳ | android.net.vcn.VcnConfig.Builder |
This class is used to incrementally build VcnConfig
objects.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
VcnConfig.Builder |
addGatewayConnectionConfig(gatewayConnectionConfig: VcnGatewayConnectionConfig) Adds a configuration for an individual gateway connection. |
VcnConfig |
build() Builds and validates the VcnConfig. |
VcnConfig.Builder |
setRestrictedUnderlyingNetworkTransports(transports: MutableSet<Int!>) Sets transports that will be restricted by the VCN. |
Public constructors
Builder
Builder(context: Context)
Parameters | |
---|---|
context |
Context: This value cannot be null . |
Public methods
addGatewayConnectionConfig
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
fun build(): VcnConfig
Builds and validates the VcnConfig.
Return | |
---|---|
VcnConfig |
an immutable VcnConfig instance This value cannot be null . |
setRestrictedUnderlyingNetworkTransports
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. |