# NetworkLocation


```
class NetworkLocation : Parcelable
```

<br />

*** ** * ** ***

Represents a network location at which a particular service can be reached.

## Summary

| ### Public functions |
|---|---|
| `java-static https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation!` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#create(java.net.InetAddress,int)(ipAddress: https://developer.android.com/reference/java/net/InetAddress.html!, port: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Returns a new `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation` instance for the given `ipAddress` and ` port`. |
| `java-static https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation!` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#create(java.lang.String,int)(ipAddress: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!, port: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Returns a new `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation` instance for the given `ipAddress` string and {code port}. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#equals(java.lang.Object)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#getFormattedIpAddress()()` Returns the IP address as a formatted string, including the scope ID if the IP address is an IPv6 address with the scope ID specified. |
| `https://developer.android.com/reference/java/net/InetAddress.html!` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#getIpAddress()()` Returns the IP address associated with this location. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#hashCode()()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#toString()()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#writeToParcel(android.os.Parcel,int)(dest: https://developer.android.com/reference/android/os/Parcel.html!, flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation#port()` |

### Inherited Constants

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR = 1` `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE = 1`

### Inherited functions

From [android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) `abstract https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/os/Parcelable.html#describeContents()()`

## Public functions

### create

```
java-static fun create(ipAddress: InetAddress!, port: Int): NetworkLocation!
```

Returns a new `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation` instance for the given `ipAddress` and `
port`.

### create

```
java-static fun create(ipAddress: String!, port: Int): NetworkLocation!
```

Returns a new `https://developers.home.google.com/reference/kotlin/com/google/android/gms/home/matter/common/NetworkLocation` instance for the given `ipAddress` string and {code port}. If the IP address string includes a scope ID (e.g. fe80::0:2%43) this scope will be included in the `https://developer.android.com/reference/java/net/Inet6Address.html`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if the `ipAddress` is malformed or if the interface id isn't available. |

### equals

```
fun equals(other: Any?): Boolean
```

### getFormattedIpAddress

```
fun getFormattedIpAddress(): String!
```

Returns the IP address as a formatted string, including the scope ID if the IP address is an IPv6 address with the scope ID specified. (e.g. fe80::0:2%47)

### getIpAddress

```
fun getIpAddress(): InetAddress!
```

Returns the IP address associated with this location.

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String!
```

### writeToParcel

```
fun writeToParcel(dest: Parcel!, flags: Int): Unit
```

## Public properties

### port

```
val port: Int
```