Class AssociationRequest.Builder
java.lang.Object
com.codename1.nearby.companion.AssociationRequest.Builder
- Enclosing class:
AssociationRequest
Assembles an
AssociationRequest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFilter(DeviceFilter filter) Adds a filter.build()Builds the request.profile(CompanionProfile profile) Sets the profile.singleDevice(boolean singleDevice) Asks the platform to skip the chooser when exactly one device matches the filters.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
profile
Sets the profile. Defaults to
CompanionProfile.GENERIC, which is what most accessories should ask for.Parameters
profile: the profile to request
Returns
this builder
-
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
singleDevice: whether to take the shortcut
Returns
this builder
-
addFilter
Adds a filter. Filters are OR-combined.
Parameters
filter: the filter to add
Returns
this builder
-
build
Builds the request.
Returns
the immutable request
-