Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#inhmethods)

# StaticIpConfiguration.Builder

*** ** * ** ***


`
public
static
final

class
StaticIpConfiguration.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.StaticIpConfiguration.Builder |

<br />

*** ** * ** ***

Helper class to build a new instance of `https://developer.android.com/reference/android/net/StaticIpConfiguration`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/net/StaticIpConfiguration` | ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#build()() ` Create a `https://developer.android.com/reference/android/net/StaticIpConfiguration` from the parameters in this `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder`. |
| ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#setDnsServers(java.lang.Iterable<java.net.InetAddress>)(https://developer.android.com/reference/java/lang/Iterable<https://developer.android.com/reference/java/net/InetAddress> dnsServers) ` Set the addresses of the DNS servers included in the configuration; empty by default. |
| ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#setDomains(java.lang.String)(https://developer.android.com/reference/java/lang/String newDomains) ` Sets the DNS domain search path to be used on the link; null by default. |
| ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#setGateway(java.net.InetAddress)(https://developer.android.com/reference/java/net/InetAddress gateway) ` Set the address of the gateway to be included in the configuration; null by default. |
| ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | ` https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#setIpAddress(android.net.LinkAddress)(https://developer.android.com/reference/android/net/LinkAddress ipAddress) ` Set the IP address to be included in the configuration. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### Builder

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder ()
```

<br />

<br />

## Public methods

### build

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public StaticIpConfiguration build ()
```

Create a `https://developer.android.com/reference/android/net/StaticIpConfiguration` from the parameters in this `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/StaticIpConfiguration` | The newly created StaticIpConfiguration. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if an invalid configuration is attempted, e.g. if an IP Address was not configured via `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder#setIpAddress(android.net.LinkAddress)`. |

### setDnsServers

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public StaticIpConfiguration.Builder setDnsServers (Iterable<InetAddress> dnsServers)
```

Set the addresses of the DNS servers included in the configuration; empty by default.

<br />

| Parameters ||
|---|---|
| `dnsServers` | `Iterable`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | The `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` for chaining. This value cannot be `null`. <br /> |

### setDomains

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public StaticIpConfiguration.Builder setDomains (String newDomains)
```

Sets the DNS domain search path to be used on the link; null by default.

<br />

| Parameters ||
|---|---|
| `newDomains` | `String`: A `https://developer.android.com/reference/java/lang/String` containing the comma separated domains to search when resolving host names on this link, in priority order. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | The `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` for chaining. <br /> |

### setGateway

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public StaticIpConfiguration.Builder setGateway (InetAddress gateway)
```

Set the address of the gateway to be included in the configuration; null by default.

<br />

| Parameters ||
|---|---|
| `gateway` | `InetAddress`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | The `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` for chaining. <br /> |

### setIpAddress

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public StaticIpConfiguration.Builder setIpAddress (LinkAddress ipAddress)
```

Set the IP address to be included in the configuration.

<br />

| Parameters ||
|---|---|
| `ipAddress` | `LinkAddress`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` | The `https://developer.android.com/reference/android/net/StaticIpConfiguration.Builder` for chaining. This value cannot be `null`. <br /> |