public static final class AssociationRequest.Builder
- Object
- AssociationRequest.Builder
Assembles an
AssociationRequest.Constructors
public Builder() |
Methods
Inherited methods
Constructor details
Builder
public Builder()Method details
profile
public AssociationRequest.Builder profile(CompanionProfile profile)Sets the profile. Defaults to
CompanionProfile.GENERIC, which
is what most accessories should ask for.Parameters
profileCompanionProfile- the profile to request
Returns
this builder
singleDevice
public AssociationRequest.Builder singleDevice(boolean singleDevice)Asks the platform to skip the chooser when exactly one device
matches the filters. The user still consents – they are shown
one device and confirm it – so this is a shortcut, not a way to
associate silently.
Parameters
singleDeviceboolean- whether to take the shortcut
Returns
this builder
addFilter
public AssociationRequest.Builder addFilter(DeviceFilter filter)Adds a filter. Filters are OR-combined.
Parameters
filterDeviceFilter- the filter to add
Returns
this builder
build
public AssociationRequest build()Builds the request.
Returns
the immutable request