Builder


class Builder
kotlin.Any
   ↳ android.provider.PeopleContract.Groups.Query.Builder

Helper class for building structured query argument bundles to pass into ContentResolver.query(Uri,String[],Bundle,CancellationSignal) when querying Groups.CONTENT_URI.

Multiple sub-queries targeting different directory packages or selection criteria can be combined onto a single builder instance before calling build().

Summary

Public constructors

Constructs a new empty instance of Builder.

Public methods
PeopleContract.Groups.Query.Builder
addLookupQuery(packageName: String, lookupKeys: MutableList<String!>)

Adds a sub-query searching for specific group records matching the given list of opaque lookup keys within the specified directory package.

Bundle

Generates the final query arguments Bundle containing all configured group sub-queries.

Public constructors

Builder

Builder()

Constructs a new empty instance of Builder.

Public methods

addLookupQuery

fun addLookupQuery(
    packageName: String,
    lookupKeys: MutableList<String!>
): PeopleContract.Groups.Query.Builder

Adds a sub-query searching for specific group records matching the given list of opaque lookup keys within the specified directory package.

Parameters
packageName String: The package name of the target directory application.
This value cannot be null.
lookupKeys MutableList<String!>: A list of group lookup key strings to resolve.
This value cannot be null.
Return
PeopleContract.Groups.Query.Builder This builder instance for method chaining.
This value cannot be null.

build

fun build(): Bundle

Generates the final query arguments Bundle containing all configured group sub-queries.

The returned bundle can be passed directly as the query arguments parameter to ContentResolver.query(Uri,String[],Bundle,CancellationSignal).

Return
Bundle A Bundle containing the accumulated query requests under QUERY_ARG_QUERIES.
This value cannot be null.