Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for WifiDeviceFilter
Summary
Public constructors
Public methods
build
fun build(): WifiDeviceFilter
Builds the instance. This builder should not be touched after calling this!
setNamePattern
fun setNamePattern(value: Pattern?): WifiDeviceFilter.Builder
If set, only devices with name
matching the given regular expression will be shown
Parameters |
value |
Pattern?: 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,["# WifiDeviceFilter.Builder\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/companion/WifiDeviceFilter.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.companion.WifiDeviceFilter.Builder](#) |\n\nA builder for [WifiDeviceFilter](/reference/kotlin/android/companion/WifiDeviceFilter)\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [WifiDeviceFilter](/reference/kotlin/android/companion/WifiDeviceFilter) | [build](#build())`()` Builds the instance. |\n| [WifiDeviceFilter.Builder](#) | [setBssid](#setBssid(android.net.MacAddress))`(`value:` `[MacAddress](../net/MacAddress.html#)`)` If set, only devices with BSSID matching the given one will be shown |\n| [WifiDeviceFilter.Builder](#) | [setBssidMask](#setBssidMask(android.net.MacAddress))`(`value:` `[MacAddress](../net/MacAddress.html#)`)` If set, only bits at positions set in this mask, will be compared to the given [BSSID](#setBssid(android.net.MacAddress)) filter. |\n| [WifiDeviceFilter.Builder](#) | [setNamePattern](#setNamePattern(java.util.regex.Pattern))`(`value:` `[Pattern](../../java/util/regex/Pattern.html#)?`)` If set, only devices with [name](../bluetooth/BluetoothDevice.html#getName()) matching the given regular expression will be shown |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 26](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 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): WifiDeviceFilter\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|--------------------------------------------------------------------------|------------------------------|\n| [WifiDeviceFilter](/reference/kotlin/android/companion/WifiDeviceFilter) | This value cannot be `null`. |\n\n### setBssid\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setBssid(value: MacAddress): WifiDeviceFilter.Builder\n```\n\nIf set, only devices with BSSID matching the given one will be shown\n\n| Parameters ||\n|---------|---------------------------------------------------------------------|\n| `value` | [MacAddress](../net/MacAddress.html#): This value cannot be `null`. |\n\n| Return ||\n|-------------------------------|------------------------------|\n| [WifiDeviceFilter.Builder](#) | This value cannot be `null`. |\n\n### setBssidMask\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setBssidMask(value: MacAddress): WifiDeviceFilter.Builder\n```\n\nIf set, only bits at positions set in this mask, will be compared to the given [BSSID](#setBssid(android.net.MacAddress)) filter.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------|\n| `value` | [MacAddress](../net/MacAddress.html#): This value cannot be `null`. |\n\n| Return ||\n|-------------------------------|------------------------------|\n| [WifiDeviceFilter.Builder](#) | This value cannot be `null`. |\n\n### setNamePattern\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setNamePattern(value: Pattern?): WifiDeviceFilter.Builder\n```\n\nIf set, only devices with [name](../bluetooth/BluetoothDevice.html#getName()) matching the given regular expression will be shown\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------|\n| `value` | [Pattern](../../java/util/regex/Pattern.html#)?: This value may be `null`. |\n\n| Return ||\n|-------------------------------|------------------------------|\n| [WifiDeviceFilter.Builder](#) | This value cannot be `null`. |"]]