# ContactsContract.Contacts.AggregationSuggestions.Builder

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder "View this page in Java")  

```
class Builder
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                                         ||
| ↳ | [android.provider.ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#) |

A convenience builder for aggregation suggestion content URIs.

## Summary

|                                                                     Public constructors                                                                     ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                                                                            Public methods                                                                                                                                                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#)! | [addNameParameter](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#addNameParameter(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Add a name to be used when searching for aggregation suggestions. |
| [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!                                                                                                           | [build](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#build())`()` Combine all of the options that have been set and return a new[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)object for fetching aggregation suggestions.           |
| [ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#)! | [setContactId](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#setContactId(kotlin.Long))`(`contactId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Optional existing contact ID.                                               |
| [ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#)! | [setLimit](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#setLimit(kotlin.Int))`(`limit:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the Maximum number of suggested aggregations that should be returned.                 |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### addNameParameter

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun addNameParameter(name: String!): ContactsContract.Contacts.AggregationSuggestions.Builder!
```

Add a name to be used when searching for aggregation suggestions.

|                                                             Parameters                                                             ||
|--------|----------------------------------------------------------------------------------------------------------------------------|
| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:name to find aggregation suggestions for |

|                                                                                                                            Return                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#)! | This Builder object to allow for chaining of calls to builder methods |

### build

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun build(): Uri!
```

Combine all of the options that have been set and return a new[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)object for fetching aggregation suggestions.  

### setContactId

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setContactId(contactId: Long): ContactsContract.Contacts.AggregationSuggestions.Builder!
```

Optional existing contact ID. If it is not provided, the search will be based exclusively on the values supplied with[addNameParameter](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#addNameParameter(kotlin.String)).

|                                                              Parameters                                                               ||
|-------------|--------------------------------------------------------------------------------------------------------------------------|
| `contactId` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):contact to find aggregation suggestions for |

|                                                                                                                            Return                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#)! | This Builder object to allow for chaining of calls to builder methods |

### setLimit

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setLimit(limit: Int): ContactsContract.Contacts.AggregationSuggestions.Builder!
```

Sets the Maximum number of suggested aggregations that should be returned.

|                                                            Parameters                                                            ||
|---------|-------------------------------------------------------------------------------------------------------------------------|
| `limit` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The maximum number of suggested aggregations |

|                                                                                                                            Return                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [ContactsContract.Contacts.AggregationSuggestions.Builder](https://developer.android.com/reference/kotlin/android/provider/ContactsContract.Contacts.AggregationSuggestions.Builder#)! | This Builder object to allow for chaining of calls to builder methods |