Builder
class Builder
| kotlin.Any | |
| ↳ | android.health.connect.MatchmakingRequest.Builder |
Builder class for MatchmakingRequest.
By default, the builder initializes with an empty set of record types, include and exclude data sources.
Summary
| Public constructors | |
|---|---|
Builder() |
|
| Public methods | |
|---|---|
| MatchmakingRequest.Builder |
addRecordType(recordType: Class<out Record!>)Adds a record type to the request. |
| MatchmakingRequest.Builder |
addRecordTypes(recordTypes: MutableSet<Class<out Record!>!>)Adds a list of record types to the request. |
| MatchmakingRequest |
build()Builds the |
| MatchmakingRequest.Builder |
setExcludedDataSources(dataOrigins: MutableSet<DataOrigin!>)Sets the |
| MatchmakingRequest.Builder |
setIncludedDataSources(dataOrigins: MutableSet<DataOrigin!>)Sets the |
Public constructors
Public methods
addRecordType
fun addRecordType(recordType: Class<out Record!>): MatchmakingRequest.Builder
Adds a record type to the request.
| Parameters | |
|---|---|
recordType |
Class<out Record!>: The record type to add. This value cannot be null. |
| Return | |
|---|---|
MatchmakingRequest.Builder |
This builder. This value cannot be null. |
addRecordTypes
fun addRecordTypes(recordTypes: MutableSet<Class<out Record!>!>): MatchmakingRequest.Builder
Adds a list of record types to the request.
| Parameters | |
|---|---|
recordTypes |
MutableSet<Class<out Record!>!>: The list of record types to add. This value cannot be null. |
| Return | |
|---|---|
MatchmakingRequest.Builder |
This builder. This value cannot be null. |
build
fun build(): MatchmakingRequest
Builds the MatchmakingRequest instance.
By default, MatchmakingRequest.Builder().build() creates a request with an empty set of record types, included and excluded data sources. See description at HealthConnectManager.createMatchmakingIntent(MatchmakingRequest).
| Return | |
|---|---|
MatchmakingRequest |
A new instance of MatchmakingRequest. This value cannot be null. |
setExcludedDataSources
fun setExcludedDataSources(dataOrigins: MutableSet<DataOrigin!>): MatchmakingRequest.Builder
Sets the DataOrigins to be excluded from matchmaking. Data sources in this set will not be considered. Providing an empty set means no specific data sources are excluded, effectively allowing all data sources to be considered (unless included by setIncludedDataSources(Set)).
By default, if neither setIncludedDataSources nor setExcludedDataSources are called, all available data sources will be considered.
| Parameters | |
|---|---|
dataOrigins |
MutableSet<DataOrigin!>: The data origins to exclude. An empty set means no specific data sources are excluded. This value cannot be null. |
| Return | |
|---|---|
MatchmakingRequest.Builder |
This builder. This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if setIncludedDataSources has been called with a non-empty set. |
setIncludedDataSources
fun setIncludedDataSources(dataOrigins: MutableSet<DataOrigin!>): MatchmakingRequest.Builder
Sets the DataOrigins to be considered by matchmaking. Only data sources in this set will be considered; data sources not in this set will be excluded. Providing an empty set means no specific data sources are included, effectively allowing all data sources to be considered (unless excluded by setExcludedDataSources(Set).
By default, if neither setIncludedDataSources nor setExcludedDataSources are called, all available data sources will be considered.
| Parameters | |
|---|---|
dataOrigins |
MutableSet<DataOrigin!>: The data origins to include. An empty set means no specific data sources are included. This value cannot be null. |
| Return | |
|---|---|
MatchmakingRequest.Builder |
This builder. This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if setExcludedDataSources has been called with a non-empty set. |