# AvailableNetworkInfo.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/telephony/AvailableNetworkInfo.Builder "View this page in Java")  

```
class Builder
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                   ||
| ↳ | [android.telephony.AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) |

Provides a convenient way to set the fields of a[AvailableNetworkInfo](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo)when creating a new instance.

The example below shows how you might create a new`AvailableNetworkInfo`:  

```kotlin
<code>
 
  AvailableNetworkInfo aNI = new AvailableNetworkInfo.Builder(subId)
      .setPriority(AvailableNetworkInfo.PRIORITY_MED)
      .setRadioAccessSpecifiers(radioAccessSpecifiers)
      .setMccMncs(mccMncs)
      .build();
  </code>
```

## Summary

|                                                                                                                                       Public constructors                                                                                                                                        ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#Builder(kotlin.Int))`(`subId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates an AvailableNetworkInfo Builder with specified subscription id. |

|                                                                                                                                                                                                                                                                                                             Public methods                                                                                                                                                                                                                                                                                                             ||
|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AvailableNetworkInfo](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo)                  | [build](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#build())`()` <br />                                                                                                                                                                                                                                                                                                                                                                              |
| [AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) | [setMccMncs](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#setMccMncs(kotlin.collections.MutableList))`(`mccMncs:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Sets the list of mccmncs associated with the subscription id.                                                                        |
| [AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) | [setPriority](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#setPriority(kotlin.Int))`(`priority:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the priority for the subscription id.                                                                                                                                                                                                                            |
| [AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) | [setRadioAccessSpecifiers](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#setRadioAccessSpecifiers(kotlin.collections.MutableList))`(`radioAccessSpecifiers:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[RadioAccessSpecifier](https://developer.android.com/reference/kotlin/android/telephony/RadioAccessSpecifier)!>`)` Sets the list of mccmncs associated with the subscription id. |

## Public constructors

### Builder

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

```
Builder(subId: Int)
```

Creates an AvailableNetworkInfo Builder with specified subscription id.

|                                                  Parameters                                                  ||
|---------|-----------------------------------------------------------------------------------------------------|
| `subId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):of the availableNetwork. |

## Public methods

### build

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

```
fun build(): AvailableNetworkInfo
```

|                                                                                                            Return                                                                                                            ||
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| [AvailableNetworkInfo](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo) | an AvailableNetworkInfo object with all the fields previously set by the Builder. This value cannot be`null`. |

### setMccMncs

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

```
fun setMccMncs(mccMncs: MutableList<String!>): AvailableNetworkInfo.Builder
```

Sets the list of mccmncs associated with the subscription id.

|                                                                                                                                                                                                                                 Parameters                                                                                                                                                                                                                                  ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `mccMncs` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:nonull list of mccmncs. An empty List is still accepted. Please read documentation in[AvailableNetworkInfo](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo)to see consequences of an empty List. This value cannot be`null`. |

|                                                                                          Return                                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) | the original Builder object. This value cannot be`null`. |

### setPriority

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

```
fun setPriority(priority: Int): AvailableNetworkInfo.Builder
```

Sets the priority for the subscription id.

|                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                               ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `priority` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):of the subscription id. See[AvailableNetworkInfo.getPriority](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo#getPriority())for more details Value is[android.telephony.AvailableNetworkInfo#PRIORITY_HIGH](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo#PRIORITY_HIGH:kotlin.Int),[android.telephony.AvailableNetworkInfo#PRIORITY_MED](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo#PRIORITY_MED:kotlin.Int), or[android.telephony.AvailableNetworkInfo#PRIORITY_LOW](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo#PRIORITY_LOW:kotlin.Int) |

|                                                                                          Return                                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) | the original Builder object. This value cannot be`null`. |

### setRadioAccessSpecifiers

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

```
fun setRadioAccessSpecifiers(radioAccessSpecifiers: MutableList<RadioAccessSpecifier!>): AvailableNetworkInfo.Builder
```

Sets the list of mccmncs associated with the subscription id.

|                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                              ||
|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `radioAccessSpecifiers` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[RadioAccessSpecifier](https://developer.android.com/reference/kotlin/android/telephony/RadioAccessSpecifier)!\>:nonull list of radioAccessSpecifiers. An empty List is still accepted. Please read documentation in[AvailableNetworkInfo](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo)to see consequences of an empty List. This value cannot be`null`. |

|                                                                                          Return                                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [AvailableNetworkInfo.Builder](https://developer.android.com/reference/kotlin/android/telephony/AvailableNetworkInfo.Builder#) | the original Builder object. This value cannot be`null`. |