AssociationRequest.Builder

public static final class AssociationRequest.Builder
extends Object

java.lang.Object
   ↳ android.companion.AssociationRequest.Builder


A builder for AssociationRequest

Summary

Public constructors

AssociationRequest.Builder()

Public methods

AssociationRequest.Builder addDeviceFilter(DeviceFilter<?> deviceFilter)
AssociationRequest build()

Builds the instance Once this method is called, this builder should no longer be used.

AssociationRequest.Builder setSingleDevice(boolean singleDevice)

Protected methods

void checkNotUsed()
void markUsed()

Inherited methods

Public constructors

AssociationRequest.Builder

added in API level 26
public AssociationRequest.Builder ()

Public methods

addDeviceFilter

added in API level 26
public AssociationRequest.Builder addDeviceFilter (DeviceFilter<?> deviceFilter)

Parameters
deviceFilter DeviceFilter: if set, only devices matching the given filter will be shown to the user

This value may be null.

Returns
AssociationRequest.Builder

This value will never be null.

build

added in API level 26
public AssociationRequest build ()

Builds the instance Once this method is called, this builder should no longer be used. Any subsequent calls to a setter or build() will throw an exception

Returns
AssociationRequest

This value will never be null.

setSingleDevice

added in API level 26
public AssociationRequest.Builder setSingleDevice (boolean singleDevice)

Parameters
singleDevice boolean: if true, scanning for a device will stop as soon as at least one fitting device is found

Returns
AssociationRequest.Builder

This value will never be null.

Protected methods

checkNotUsed

protected void checkNotUsed ()

markUsed

protected void markUsed ()