PeopleContract.Groups.Query.Builder


public static final class PeopleContract.Groups.Query.Builder
extends Object

java.lang.Object
   ↳ 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

Builder()

Constructs a new empty instance of Builder.

Public methods

PeopleContract.Groups.Query.Builder addLookupQuery(String packageName, List<String> lookupKeys)

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

Bundle build()

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

Inherited methods

Public constructors

Builder

Added in API level 10000
public Builder ()

Constructs a new empty instance of Builder.

Public methods

addLookupQuery

Added in API level 10000
public PeopleContract.Groups.Query.Builder addLookupQuery (String packageName, 
                List<String> lookupKeys)

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 List: A list of group lookup key strings to resolve.
This value cannot be null.

Returns
PeopleContract.Groups.Query.Builder This builder instance for method chaining.
This value cannot be null.

build

Added in API level 10000
public Bundle build ()

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).

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