public static final class DnsSdServiceInfo.Builder extends Object
Builder class to generate DnsSdServiceInfo
instances.
Public Constructor Summary
Builder()
|
Public Method Summary
DnsSdServiceInfo.Builder |
addAllNetworkLocations(List<NetworkLocation>
networkLocations)
Adds the given list of
NetworkLocation s.
|
DnsSdServiceInfo.Builder | |
DnsSdServiceInfo.Builder | |
DnsSdServiceInfo.Builder | |
DnsSdServiceInfo |
build()
Builds a new instance of
DnsSdServiceInfo as configured in this builder.
|
DnsSdServiceInfo.Builder | |
DnsSdServiceInfo.Builder |
Inherited Method Summary
Public Constructors
public Builder ()
Public Methods
public DnsSdServiceInfo.Builder addAllNetworkLocations (List<NetworkLocation> networkLocations)
Adds the given list of NetworkLocation
s.
Returns
- this builder
public DnsSdServiceInfo.Builder addAllTxtRecords (Collection<TxtRecord> txtRecords)
Adds the given txtRecords
.
Returns
- this builder
Throws
IllegalArgumentException | if a TxtRecord
with the same key has already been added, or txtRecords contains any
duplicate keys |
---|
public DnsSdServiceInfo.Builder addNetworkLocation (NetworkLocation networkLocation)
Adds the given NetworkLocation
.
Returns
- this builder
public DnsSdServiceInfo.Builder addTxtRecord (TxtRecord txtRecord)
Adds the given txtRecord
.
Returns
- this builder
Throws
IllegalArgumentException | if a TxtRecord
with the same key has already been added |
---|
public DnsSdServiceInfo build ()
Builds a new instance of
DnsSdServiceInfo
as configured in this builder.
Throws
IllegalStateException | if the instance name or service type are missing or empty, or the list of network locations is empty |
---|
public DnsSdServiceInfo.Builder setInstanceName (String instanceName)
Set the DNS-SD instance name of the service.
Returns
- this builder
Throws
IllegalArgumentException | if instanceName is empty |
---|
public DnsSdServiceInfo.Builder setServiceType (String serviceType)
Set the DNS-SD service type.
Returns
- this builder
Throws
IllegalArgumentException | if serviceType is empty |
---|