AvailableNetworkInfo.Builder


public static final class AvailableNetworkInfo.Builder
extends Object

java.lang.Object
   ↳ android.telephony.AvailableNetworkInfo.Builder


Provides a convenient way to set the fields of a AvailableNetworkInfo when creating a new instance.

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



 AvailableNetworkInfo aNI = new AvailableNetworkInfo.Builder(subId)
     .setPriority(AvailableNetworkInfo.PRIORITY_MED)
     .setRadioAccessSpecifiers(radioAccessSpecifiers)
     .setMccMncs(mccMncs)
     .build();
 

Summary

Public constructors

Builder(int subId)

Creates an AvailableNetworkInfo Builder with specified subscription id.

Public methods

AvailableNetworkInfo build()
AvailableNetworkInfo.Builder setMccMncs(List<String> mccMncs)

Sets the list of mccmncs associated with the subscription id.

AvailableNetworkInfo.Builder setPriority(int priority)

Sets the priority for the subscription id.

AvailableNetworkInfo.Builder setRadioAccessSpecifiers(List<RadioAccessSpecifier> radioAccessSpecifiers)

Sets the list of mccmncs associated with the subscription id.

Inherited methods

Public constructors

Builder

Added in API level 33
public Builder (int subId)

Creates an AvailableNetworkInfo Builder with specified subscription id.

Parameters
subId int: of the availableNetwork.

Public methods

build

Added in API level 33
public AvailableNetworkInfo build ()

Returns
AvailableNetworkInfo an AvailableNetworkInfo object with all the fields previously set by the Builder. This value cannot be null.

setMccMncs

Added in API level 33
public AvailableNetworkInfo.Builder setMccMncs (List<String> mccMncs)

Sets the list of mccmncs associated with the subscription id.

Parameters
mccMncs List: nonull list of mccmncs. An empty List is still accepted. Please read documentation in AvailableNetworkInfo to see consequences of an empty List. This value cannot be null.

Returns
AvailableNetworkInfo.Builder the original Builder object. This value cannot be null.

setPriority

Added in API level 33
public AvailableNetworkInfo.Builder setPriority (int priority)

Sets the priority for the subscription id.

Parameters
priority int: of the subscription id. See AvailableNetworkInfo#getPriority for more details Value is AvailableNetworkInfo.PRIORITY_HIGH, AvailableNetworkInfo.PRIORITY_MED, or AvailableNetworkInfo.PRIORITY_LOW

Returns
AvailableNetworkInfo.Builder the original Builder object. This value cannot be null.

setRadioAccessSpecifiers

Added in API level 33
public AvailableNetworkInfo.Builder setRadioAccessSpecifiers (List<RadioAccessSpecifier> radioAccessSpecifiers)

Sets the list of mccmncs associated with the subscription id.

Parameters
radioAccessSpecifiers List: nonull list of radioAccessSpecifiers. An empty List is still accepted. Please read documentation in AvailableNetworkInfo to see consequences of an empty List. This value cannot be null.

Returns
AvailableNetworkInfo.Builder the original Builder object. This value cannot be null.