# Print output for @column tags ?> NetworkEvent.Builder - Android SDK | Android Developers

Most visited

Recently visited

NetworkEvent.Builder

public static final class NetworkEvent.Builder
extends Object

java.lang.Object
   ↳ android.media.metrics.NetworkEvent.Builder


A builder for NetworkEvent

Summary

Public constructors

Builder()

Creates a new Builder.

Public methods

NetworkEvent build()

Builds the instance.

NetworkEvent.Builder setMetricsBundle(Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

NetworkEvent.Builder setNetworkType(int value)

Sets network type.

NetworkEvent.Builder setTimeSinceCreatedMillis(long value)

Sets timestamp since the creation in milliseconds.

Inherited methods

Public constructors

Builder

public Builder ()

Creates a new Builder.

Public methods

build

public NetworkEvent build ()

Builds the instance.

Returns
NetworkEvent This value cannot be null.

setMetricsBundle

public NetworkEvent.Builder setMetricsBundle (Bundle metricsBundle)

Sets metrics-related information that is not supported by dedicated methods.

It is intended to be used for backwards compatibility by the metrics infrastructure.

Parameters
metricsBundle Bundle: This value cannot be null.

Returns
NetworkEvent.Builder This value cannot be null.

setNetworkType

public NetworkEvent.Builder setNetworkType (int value)

Sets network type.

Parameters
value int: Value is NetworkEvent.NETWORK_TYPE_UNKNOWN, NetworkEvent.NETWORK_TYPE_OTHER, NetworkEvent.NETWORK_TYPE_WIFI, NetworkEvent.NETWORK_TYPE_ETHERNET, NetworkEvent.NETWORK_TYPE_2G, NetworkEvent.NETWORK_TYPE_3G, NetworkEvent.NETWORK_TYPE_4G, NetworkEvent.NETWORK_TYPE_5G_NSA, NetworkEvent.NETWORK_TYPE_5G_SA, or NetworkEvent.NETWORK_TYPE_OFFLINE

Returns
NetworkEvent.Builder This value cannot be null.

setTimeSinceCreatedMillis

public NetworkEvent.Builder setTimeSinceCreatedMillis (long value)

Sets timestamp since the creation in milliseconds.

Parameters
value long: the timestamp since the creation in milliseconds. -1 indicates the value is unknown. Value is -1 or greater

Returns
NetworkEvent.Builder This value cannot be null.

See also: