# DnsSdServiceInfo

public final class **DnsSdServiceInfo** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
implements [Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) Information about a resolved Matter DNS-SD service.

### Nested Class Summary

|---|---|---|---|
| class | [DnsSdServiceInfo.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo.Builder) || Builder class to generate `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo` instances. |

### Inherited Constant Summary

From interface android.os.Parcelable

|---|---|---|
| int | CONTENTS_FILE_DESCRIPTOR |   |
| int | PARCELABLE_STABILITY_LOCAL |   |
| int | PARCELABLE_STABILITY_VINTF |   |
| int | PARCELABLE_WRITE_RETURN_VALUE |   |

### Public Method Summary

|---|---|
| static [DnsSdServiceInfo.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo.Builder) | [builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#builder())() Returns an empty `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo.Builder` instance. |
| boolean | [equals](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) o) |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getInstanceName](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getInstanceName())() Returns the DNS-SD instance name of this service. |
| [List](https://developer.android.com/reference/java/util/List.html)\<[NetworkLocation](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation)\> | [getNetworkLocations](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getNetworkLocations())() Returns all `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation`s for the device, sorted in descending priority. |
| [NetworkLocation](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation) | [getPrimaryNetworkLocation](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getPrimaryNetworkLocation())() Returns the highest priority `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation` from `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getNetworkLocations()`. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getServiceType](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getServiceType())() Returns the DNS-SD service type (e.g. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getTxtAttributeValue](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getTxtAttributeValue(java.lang.String))([String](https://developer.android.com/reference/java/lang/String.html) key) Returns the value of the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/TxtRecord` that matches the given `key`, if present; else returns null. |
| [List](https://developer.android.com/reference/java/util/List.html)\<[TxtRecord](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/TxtRecord)\> | [getTxtRecords](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getTxtRecords())() Returns all TXT records for the device. |
| boolean | [hasTxtAttribute](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#hasTxtAttribute(java.lang.String))([String](https://developer.android.com/reference/java/lang/String.html) key) Returns true if there is a TXT record for the given `key`. |
| int | [hashCode](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#hashCode())() |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#toString())() |
| void | [writeToParcel](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#writeToParcel(android.os.Parcel,%20int))([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags) |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface android.os.Parcelable

|---|---|
| abstract int | describeContents() |
| abstract void | writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |

## Public Methods

#### public static [DnsSdServiceInfo.Builder](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo.Builder) **builder**
()

Returns an empty `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo.Builder` instance.

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) o)

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getInstanceName** ()

Returns the DNS-SD instance name of this service.

#### public [List](https://developer.android.com/reference/java/util/List.html)\<[NetworkLocation](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation)\>
**getNetworkLocations** ()

Returns all `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation`s
for the device, sorted in descending priority. This list will always contain at least
one entry.

#### public [NetworkLocation](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation)
**getPrimaryNetworkLocation** ()

Returns the highest priority `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/common/NetworkLocation`
from `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getNetworkLocations()`. This is always equivalent to the first entry in
`https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/DnsSdServiceInfo#getNetworkLocations()` and is provided as a convenience.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getServiceType** ()

Returns the DNS-SD service type (e.g. _matter._tcp).

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getTxtAttributeValue** ([String](https://developer.android.com/reference/java/lang/String.html) key)

Returns the value of the `https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/TxtRecord`
that matches the given `key`, if present; else returns null.

##### Parameters

| key | the attribute key; case is ignored when matching |
|---|---|

#### public [List](https://developer.android.com/reference/java/util/List.html)\<[TxtRecord](https://developers.home.google.com/android/reference/com/google/android/gms/home/matter/discovery/TxtRecord)\>
**getTxtRecords** ()

Returns all TXT records for the device.

#### public boolean **hasTxtAttribute** ([String](https://developer.android.com/reference/java/lang/String.html) key)

Returns true if there is a TXT record for the given `key`.

##### Parameters

| key | the attribute key; case is ignored when matching |
|---|---|

#### public int **hashCode** ()

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()

#### public void **writeToParcel** ([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags)