DnsSdServiceInfo.Builder

class DnsSdServiceInfo.Builder


Builder class to generate DnsSdServiceInfo instances.

Summary

Public constructors

Public functions

DnsSdServiceInfo.Builder!

Adds the given list of NetworkLocations.

DnsSdServiceInfo.Builder!

Adds the given txtRecords.

DnsSdServiceInfo.Builder!

Adds the given NetworkLocation.

DnsSdServiceInfo.Builder!

Adds the given txtRecord.

DnsSdServiceInfo!

Builds a new instance of DnsSdServiceInfo as configured in this builder.

DnsSdServiceInfo.Builder!

Set the DNS-SD instance name of the service.

DnsSdServiceInfo.Builder!

Set the DNS-SD service type.

Public constructors

Builder

Builder()

Public functions

addAllNetworkLocations

@CanIgnoreReturnValue
fun addAllNetworkLocations(
    networkLocations: (Mutable)List<NetworkLocation!>!
): DnsSdServiceInfo.Builder!

Adds the given list of NetworkLocations.

Returns
DnsSdServiceInfo.Builder!

this builder

addAllTxtRecords

@CanIgnoreReturnValue
fun addAllTxtRecords(txtRecords: (Mutable)Collection<TxtRecord!>!): DnsSdServiceInfo.Builder!

Adds the given txtRecords.

Returns
DnsSdServiceInfo.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if a TxtRecord with the same key has already been added, or txtRecords contains any duplicate keys

addNetworkLocation

@CanIgnoreReturnValue
fun addNetworkLocation(networkLocation: NetworkLocation!): DnsSdServiceInfo.Builder!

Adds the given NetworkLocation.

Returns
DnsSdServiceInfo.Builder!

this builder

addTxtRecord

@CanIgnoreReturnValue
fun addTxtRecord(txtRecord: TxtRecord!): DnsSdServiceInfo.Builder!

Adds the given txtRecord.

Returns
DnsSdServiceInfo.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if a TxtRecord with the same key has already been added

build

fun build(): DnsSdServiceInfo!

Builds a new instance of DnsSdServiceInfo as configured in this builder.

Throws
java.lang.IllegalStateException

if the instance name or service type are missing or empty, or the list of network locations is empty

setInstanceName

@CanIgnoreReturnValue
fun setInstanceName(instanceName: String!): DnsSdServiceInfo.Builder!

Set the DNS-SD instance name of the service.

Returns
DnsSdServiceInfo.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if instanceName is empty

setServiceType

@CanIgnoreReturnValue
fun setServiceType(serviceType: String!): DnsSdServiceInfo.Builder!

Set the DNS-SD service type.

Returns
DnsSdServiceInfo.Builder!

this builder

Throws
java.lang.IllegalArgumentException

if serviceType is empty