Builder


class Builder
kotlin.Any
   ↳ android.net.nsd.AdvertisingRequest.Builder

A builder for creating new AdvertisingRequest objects.

Summary

Public constructors
Builder(serviceInfo: NsdServiceInfo)

Creates a new Builder object.

Public methods
AdvertisingRequest

Creates a new AdvertisingRequest object.

AdvertisingRequest.Builder
setFlags(flags: Long)

Sets advertising configuration flags.

AdvertisingRequest.Builder
setProtocolType(protocolType: Int)

Sets the protocol to use for advertising.

Public constructors

Builder

Builder(serviceInfo: NsdServiceInfo)

Creates a new Builder object.

Parameters
serviceInfo NsdServiceInfo: the NsdServiceInfo describing the service to advertise. This value cannot be null.

Public methods

build

fun build(): AdvertisingRequest

Creates a new AdvertisingRequest object.

Return
AdvertisingRequest This value cannot be null.

setFlags

fun setFlags(flags: Long): AdvertisingRequest.Builder

Sets advertising configuration flags.

Parameters
flags Long: flags to use for advertising. Value is either 0 or android.net.nsd.AdvertisingRequest#FLAG_SKIP_PROBING
Return
AdvertisingRequest.Builder This value cannot be null.

setProtocolType

fun setProtocolType(protocolType: Int): AdvertisingRequest.Builder

Sets the protocol to use for advertising.

Parameters
protocolType Int: the advertising protocol to use. Value is android.net.nsd.NsdManager#PROTOCOL_DNS_SD
Return
AdvertisingRequest.Builder This value cannot be null.