# VcnWifiUnderlyingNetworkTemplate.Builder

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#inhmethods)  

# VcnWifiUnderlyingNetworkTemplate.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder "View this page in Kotlin")\|Java

`
public
static
final

class
VcnWifiUnderlyingNetworkTemplate.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|----------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder |

<br />

*** ** * ** ***

This class is used to incrementally build VcnWifiUnderlyingNetworkTemplate objects.

## Summary

|                                                                   ### Public constructors                                                                    ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#Builder())`() ` Construct a Builder object. |

|                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[VcnWifiUnderlyingNetworkTemplate](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate)                 | ` `[build](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#build())`() ` Build the VcnWifiUnderlyingNetworkTemplate.                                                                                                                                                                                                     |
| ` `[VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | ` `[setMetered](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#setMetered(int))`(int matchCriteria) ` Set the matching criteria for metered networks.                                                                                                                                                                   |
| ` `[VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | ` `[setMinDownstreamBandwidthKbps](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#setMinDownstreamBandwidthKbps(int,%20int))`(int minEntryDownstreamBandwidthKbps, int minExitDownstreamBandwidthKbps) ` Set the minimum upstream bandwidths that this template will match.                                             |
| ` `[VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | ` `[setMinUpstreamBandwidthKbps](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#setMinUpstreamBandwidthKbps(int,%20int))`(int minEntryUpstreamBandwidthKbps, int minExitUpstreamBandwidthKbps) ` Set the minimum upstream bandwidths that this template will match.                                                     |
| ` `[VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | ` `[setSsids](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder#setSsids(java.util.Set<java.lang.String>))`(`[Set](https://developer.android.com/reference/java/util/Set)`<`[String](https://developer.android.com/reference/java/lang/String)`> ssids) ` Set the SSIDs with which a network can match this priority rule. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Builder ()
```

Construct a Builder object.

<br />

## Public methods

### build

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public VcnWifiUnderlyingNetworkTemplate build ()
```

Build the VcnWifiUnderlyingNetworkTemplate.

<br />

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [VcnWifiUnderlyingNetworkTemplate](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate) | This value cannot be`null`. <br /> |

### setMetered

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public VcnWifiUnderlyingNetworkTemplate.Builder setMetered (int matchCriteria)
```

Set the matching criteria for metered networks.

A template where setMetered(MATCH_REQUIRED) will only match metered networks (one without NET_CAPABILITY_NOT_METERED). A template where setMetered(MATCH_FORBIDDEN) will only match a network that is not metered (one with NET_CAPABILITY_NOT_METERED).

<br />

|                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                          ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `matchCriteria` | `int`: the matching criteria for metered networks. Defaults to[VcnUnderlyingNetworkTemplate.MATCH_ANY](https://developer.android.com/reference/android/net/vcn/VcnUnderlyingNetworkTemplate#MATCH_ANY). Value is[VcnUnderlyingNetworkTemplate.MATCH_ANY](https://developer.android.com/reference/android/net/vcn/VcnUnderlyingNetworkTemplate#MATCH_ANY),[VcnUnderlyingNetworkTemplate.MATCH_REQUIRED](https://developer.android.com/reference/android/net/vcn/VcnUnderlyingNetworkTemplate#MATCH_REQUIRED), or[VcnUnderlyingNetworkTemplate.MATCH_FORBIDDEN](https://developer.android.com/reference/android/net/vcn/VcnUnderlyingNetworkTemplate#MATCH_FORBIDDEN) <br /> |

|                                                                                     Returns                                                                                      ||
|----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | This value cannot be`null`. <br /> |

**See also:**

- [NetworkCapabilities.NET_CAPABILITY_NOT_METERED](https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_NOT_METERED)  

### setMinDownstreamBandwidthKbps

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public VcnWifiUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps (int minEntryDownstreamBandwidthKbps, 
                int minExitDownstreamBandwidthKbps)
```

Set the minimum upstream bandwidths that this template will match.

This template will not match a network that does not provide at least the bandwidth passed as the entry bandwidth, except in the case that the network is selected as the VCN Gateway Connection's underlying network, where it will continue to match until the bandwidth drops under the exit bandwidth.

The entry criteria MUST be greater than, or equal to the exit criteria to avoid the invalid case where a network fulfills the entry criteria, but at the same time fails the exit criteria.

Estimated bandwidth of a network is provided by the transport layer, and reported in[NetworkCapabilities](https://developer.android.com/reference/android/net/NetworkCapabilities). The provided estimates will be used without modification.

<br />

|                                                                                                      Parameters                                                                                                      ||
|-----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `minEntryDownstreamBandwidthKbps` | `int`: the minimum accepted downstream bandwidth for networks that ARE NOT the already-selected underlying network, or`0`to disable this requirement. Disabled by default. <br /> |
| `minExitDownstreamBandwidthKbps`  | `int`: the minimum accepted downstream bandwidth for a network that IS the already-selected underlying network, or`0`to disable this requirement. Disabled by default. <br />     |

|                                                                                                                                                        Returns                                                                                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | this[Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder)instance, for chaining This value cannot be`null`. <br /> |

### setMinUpstreamBandwidthKbps

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public VcnWifiUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps (int minEntryUpstreamBandwidthKbps, 
                int minExitUpstreamBandwidthKbps)
```

Set the minimum upstream bandwidths that this template will match.

This template will not match a network that does not provide at least the bandwidth passed as the entry bandwidth, except in the case that the network is selected as the VCN Gateway Connection's underlying network, where it will continue to match until the bandwidth drops under the exit bandwidth.

The entry criteria MUST be greater than, or equal to the exit criteria to avoid the invalid case where a network fulfills the entry criteria, but at the same time fails the exit criteria.

Estimated bandwidth of a network is provided by the transport layer, and reported in[NetworkCapabilities](https://developer.android.com/reference/android/net/NetworkCapabilities). The provided estimates will be used without modification.

<br />

|                                                                                                    Parameters                                                                                                    ||
|---------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `minEntryUpstreamBandwidthKbps` | `int`: the minimum accepted upstream bandwidth for networks that ARE NOT the already-selected underlying network, or`0`to disable this requirement. Disabled by default. <br /> |
| `minExitUpstreamBandwidthKbps`  | `int`: the minimum accepted upstream bandwidth for a network that IS the already-selected underlying network, or`0`to disable this requirement. Disabled by default. <br />     |

|                                                                                                                                                        Returns                                                                                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | this[Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder)instance, for chaining This value cannot be`null`. <br /> |

### setSsids

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public VcnWifiUnderlyingNetworkTemplate.Builder setSsids (Set<String> ssids)
```

Set the SSIDs with which a network can match this priority rule.

<br />

|                                                                                                     Parameters                                                                                                     ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ssids` | `Set`: the matching SSIDs. Network with one of the matching SSIDs can match this priority rule. If the set is empty, any SSID will match. The default is an empty set. This value cannot be`null`. <br /> |

|                                                                                     Returns                                                                                      ||
|----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [VcnWifiUnderlyingNetworkTemplate.Builder](https://developer.android.com/reference/android/net/vcn/VcnWifiUnderlyingNetworkTemplate.Builder) | This value cannot be`null`. <br /> |