Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Helper class to build a new instance of StaticIpConfiguration
.
Summary
Public constructors
Public methods
setDomains
fun setDomains(newDomains: String?): StaticIpConfiguration.Builder
Sets the DNS domain search path to be used on the link; null by default.
Parameters |
newDomains |
String?: A String containing the comma separated domains to search when resolving host names on this link, in priority order. This value may be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# StaticIpConfiguration.Builder\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/StaticIpConfiguration.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.net.StaticIpConfiguration.Builder](#) |\n\nHelper class to build a new instance of [StaticIpConfiguration](/reference/kotlin/android/net/StaticIpConfiguration).\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [StaticIpConfiguration](/reference/kotlin/android/net/StaticIpConfiguration) | [build](#build())`()` Create a [StaticIpConfiguration](/reference/kotlin/android/net/StaticIpConfiguration) from the parameters in this [Builder](#). |\n| [StaticIpConfiguration.Builder](#) | [setDnsServers](#setDnsServers(kotlin.collections.MutableIterable))`(`dnsServers:` `[MutableIterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-iterable/index.html)\u003c[InetAddress](../../java/net/InetAddress.html#)!\u003e`)` Set the addresses of the DNS servers included in the configuration; empty by default. |\n| [StaticIpConfiguration.Builder](#) | [setDomains](#setDomains(kotlin.String))`(`newDomains:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Sets the DNS domain search path to be used on the link; null by default. |\n| [StaticIpConfiguration.Builder](#) | [setGateway](#setGateway(java.net.InetAddress))`(`gateway:` `[InetAddress](../../java/net/InetAddress.html#)?`)` Set the address of the gateway to be included in the configuration; null by default. |\n| [StaticIpConfiguration.Builder](#) | [setIpAddress](#setIpAddress(android.net.LinkAddress))`(`ipAddress:` `[LinkAddress](/reference/kotlin/android/net/LinkAddress)`)` Set the IP address to be included in the configuration. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): StaticIpConfiguration\n```\n\nCreate a [StaticIpConfiguration](/reference/kotlin/android/net/StaticIpConfiguration) from the parameters in this [Builder](#).\n\n| Return ||\n|------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [StaticIpConfiguration](/reference/kotlin/android/net/StaticIpConfiguration) | The newly created StaticIpConfiguration. This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `java.lang.IllegalArgumentException` | if an invalid configuration is attempted, e.g. if an IP Address was not configured via [setIpAddress(android.net.LinkAddress)](#setIpAddress(android.net.LinkAddress)). |\n\n### setDnsServers\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setDnsServers(dnsServers: MutableIterable\u003cInetAddress!\u003e): StaticIpConfiguration.Builder\n```\n\nSet the addresses of the DNS servers included in the configuration; empty by default.\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dnsServers` | [MutableIterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-iterable/index.html)\\\u003c[InetAddress](../../java/net/InetAddress.html#)!\\\u003e: This value cannot be `null`. |\n\n| Return ||\n|------------------------------------|-------------------------------------------------------------|\n| [StaticIpConfiguration.Builder](#) | The [Builder](#) for chaining. This value cannot be `null`. |\n\n### setDomains\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setDomains(newDomains: String?): StaticIpConfiguration.Builder\n```\n\nSets the DNS domain search path to be used on the link; null by default.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `newDomains` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: A [String](../../java/lang/String.html#) containing the comma separated domains to search when resolving host names on this link, in priority order. This value may be `null`. |\n\n| Return ||\n|------------------------------------|--------------------------------|\n| [StaticIpConfiguration.Builder](#) | The [Builder](#) for chaining. |\n\n### setGateway\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setGateway(gateway: InetAddress?): StaticIpConfiguration.Builder\n```\n\nSet the address of the gateway to be included in the configuration; null by default.\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------|\n| `gateway` | [InetAddress](../../java/net/InetAddress.html#)?: This value may be `null`. |\n\n| Return ||\n|------------------------------------|--------------------------------|\n| [StaticIpConfiguration.Builder](#) | The [Builder](#) for chaining. |\n\n### setIpAddress\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setIpAddress(ipAddress: LinkAddress): StaticIpConfiguration.Builder\n```\n\nSet the IP address to be included in the configuration.\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------|\n| `ipAddress` | [LinkAddress](/reference/kotlin/android/net/LinkAddress): This value cannot be `null`. |\n\n| Return ||\n|------------------------------------|-------------------------------------------------------------|\n| [StaticIpConfiguration.Builder](#) | The [Builder](#) for chaining. This value cannot be `null`. |"]]