# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# BluetoothLeDeviceFilter.Builder

`public static final class BluetoothLeDeviceFilter.Builder`
`extends Object` ``

java.lang.Object
↳ | android.companion.BluetoothLeDeviceFilter.Builder

Builder for `BluetoothLeDeviceFilter`

## Summary

### Public constructors
`Builder()`

### Public methods
`BluetoothLeDeviceFilter` | `build()`
`BluetoothLeDeviceFilter.Builder` | `setNamePattern(Pattern regex)`
`BluetoothLeDeviceFilter.Builder` | `setRawDataFilter(byte[] rawDataFilter, byte[] rawDataFilterMask)` Filter devices by raw advertisement data, as obtained by `ScanRecord#getBytes`
`BluetoothLeDeviceFilter.Builder` | `setRenameFromBytes(String prefix, String suffix, int bytesFrom, int bytesLength, ByteOrder byteOrder)` Rename the devices shown in the list, using specific bytes from the raw advertisement data (`ScanRecord#getBytes`) in hexadecimal format, as well as a custom prefix/suffix around them Note that the prefix length is limited to `BluetoothLeDeviceFilter.getRenamePrefixLengthLimit()` characters to ensure that there's enough space to display the byte data The range of bytes to be displayed cannot be empty
`BluetoothLeDeviceFilter.Builder` | `setRenameFromName(String prefix, String suffix, int nameFrom, int nameLength)` Rename the devices shown in the list, using specific characters from the advertised name, as well as a custom prefix/suffix around them Note that the prefix length is limited to `BluetoothLeDeviceFilter.getRenamePrefixLengthLimit()` characters to ensure that there's enough space to display the byte data The range of name characters to be displayed cannot be empty
`BluetoothLeDeviceFilter.Builder` | `setScanFilter(ScanFilter scanFilter)`

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder ()

## Public methods

### build

    public BluetoothLeDeviceFilter build ()

Returns
`BluetoothLeDeviceFilter` | This value cannot be `null`.

### setNamePattern

    public BluetoothLeDeviceFilter.Builder setNamePattern (Pattern regex)

Parameters
`regex` | `Pattern`: if set, only devices with `name` matching the given regular expression will be shown This value may be `null`.

Returns
`BluetoothLeDeviceFilter.Builder` | self for chaining

### setRawDataFilter

    public BluetoothLeDeviceFilter.Builder setRawDataFilter (byte[] rawDataFilter,
                    byte[] rawDataFilterMask)

Filter devices by raw advertisement data, as obtained by `ScanRecord#getBytes`

Parameters
`rawDataFilter` | `byte`: bit values that have to match against advertized data This value cannot be `null`.
`rawDataFilterMask` | `byte`: bits that have to be matched This value may be `null`.

Returns
`BluetoothLeDeviceFilter.Builder` | self for chaining This value cannot be `null`.

### setRenameFromBytes

    public BluetoothLeDeviceFilter.Builder setRenameFromBytes (String prefix,
                    String suffix,
                    int bytesFrom,
                    int bytesLength,
                    ByteOrder byteOrder)

Rename the devices shown in the list, using specific bytes from the raw advertisement data (`ScanRecord#getBytes`) in hexadecimal format, as well as a custom prefix/suffix around them Note that the prefix length is limited to `BluetoothLeDeviceFilter.getRenamePrefixLengthLimit()` characters to ensure that there's enough space to display the byte data The range of bytes to be displayed cannot be empty

Parameters
`prefix` | `String`: to be displayed before the byte data This value cannot be `null`.
`suffix` | `String`: to be displayed after the byte data This value cannot be `null`.
`bytesFrom` | `int`: the start byte index to be displayed (inclusive)
`bytesLength` | `int`: the number of bytes to be displayed from the given index
`byteOrder` | `ByteOrder`: whether the given range of bytes is big endian (will be displayed in same order) or little endian (will be flipped before displaying)

Returns
`BluetoothLeDeviceFilter.Builder` | self for chaining This value cannot be `null`.

### setRenameFromName

    public BluetoothLeDeviceFilter.Builder setRenameFromName (String prefix,
                    String suffix,
                    int nameFrom,
                    int nameLength)

Rename the devices shown in the list, using specific characters from the advertised name, as well as a custom prefix/suffix around them Note that the prefix length is limited to `BluetoothLeDeviceFilter.getRenamePrefixLengthLimit()` characters to ensure that there's enough space to display the byte data The range of name characters to be displayed cannot be empty

Parameters
`prefix` | `String`: to be displayed before the byte data This value cannot be `null`.
`suffix` | `String`: to be displayed after the byte data This value cannot be `null`.
`nameFrom` | `int`: the start name character index to be displayed (inclusive)
`nameLength` | `int`: the number of characters to be displayed from the given index

Returns
`BluetoothLeDeviceFilter.Builder` | self for chaining This value cannot be `null`.

### setScanFilter

    public BluetoothLeDeviceFilter.Builder setScanFilter (ScanFilter scanFilter)

Parameters
`scanFilter` | `ScanFilter`: a `ScanFilter` to filter devices by This value may be `null`.

Returns
`BluetoothLeDeviceFilter.Builder` | self for chaining This value cannot be `null`.

See also:

- `for specific details on its various fields`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*