# GetByDocumentIdRequest.Builder

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#inhmethods)  

# GetByDocumentIdRequest.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/app/appsearch/GetByDocumentIdRequest.Builder "View this page in Kotlin")\|Java

`
public
static
final

class
GetByDocumentIdRequest.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.appsearch.GetByDocumentIdRequest.Builder |

<br />

*** ** * ** ***

Builder for[GetByDocumentIdRequest](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest)objects.

## Summary

|                                                                                                                                                                           ### Public constructors                                                                                                                                                                           ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#Builder(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace) ` Creates a[GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder)instance. |

|                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | ` `[addIds](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#addIds(java.lang.String[]))`(`[String...](https://developer.android.com/reference/java/lang/String)` ids) ` Adds one or more document IDs to the request.                                                                                                                                                                                                                                                                                                         |
| ` `[GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | ` `[addIds](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#addIds(java.util.Collection<java.lang.String>))`(`[Collection](https://developer.android.com/reference/java/util/Collection)`<`[String](https://developer.android.com/reference/java/lang/String)`> ids) ` Adds a collection of IDs to the request.                                                                                                                                                                                                               |
| ` `[GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | ` `[addProjection](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#addProjection(java.lang.String,%20java.util.Collection<java.lang.String>))`(`[String](https://developer.android.com/reference/java/lang/String)` schemaType, `[Collection](https://developer.android.com/reference/java/util/Collection)`<`[String](https://developer.android.com/reference/java/lang/String)`> propertyPaths) ` Adds property paths for the specified type to be used for projection.                                                     |
| ` `[GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | ` `[addProjectionPaths](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#addProjectionPaths(java.lang.String,%20java.util.Collection<android.app.appsearch.PropertyPath>))`(`[String](https://developer.android.com/reference/java/lang/String)` schemaType, `[Collection](https://developer.android.com/reference/java/util/Collection)`<`[PropertyPath](https://developer.android.com/reference/android/app/appsearch/PropertyPath)`> propertyPaths) ` Adds property paths for the specified type to be used for projection. |
| ` `[GetByDocumentIdRequest](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest)                 | ` `[build](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder#build())`() ` Builds a new[GetByDocumentIdRequest](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest).                                                                                                                                                                                                                                                                                                                          |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

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

```
public Builder (String namespace)
```

Creates a[GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder)instance.

<br />

|                        Parameters                         ||
|-------------|----------------------------------------------|
| `namespace` | `String`: This value cannot be`null`. <br /> |

## Public methods

### addIds

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

```
public GetByDocumentIdRequest.Builder addIds (String... ids)
```

Adds one or more document IDs to the request.

<br />

|                     Parameters                      ||
|-------|----------------------------------------------|
| `ids` | `String`: This value cannot be`null`. <br /> |

|                                                                              Returns                                                                               ||
|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | This value cannot be`null`. <br /> |

### addIds

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

```
public GetByDocumentIdRequest.Builder addIds (Collection<String> ids)
```

Adds a collection of IDs to the request.

<br />

|                       Parameters                        ||
|-------|--------------------------------------------------|
| `ids` | `Collection`: This value cannot be`null`. <br /> |

|                                                                              Returns                                                                               ||
|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | This value cannot be`null`. <br /> |

### addProjection

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

```
public GetByDocumentIdRequest.Builder addProjection (String schemaType, 
                Collection<String> propertyPaths)
```

Adds property paths for the specified type to be used for projection. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type. If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

If property path is added for the[GetByDocumentIdRequest.PROJECTION_SCHEMA_TYPE_WILDCARD](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest#PROJECTION_SCHEMA_TYPE_WILDCARD), then those property paths will apply to all results, excepting any types that have their own, specific property paths set.

<br />

|                            Parameters                             ||
|-----------------|--------------------------------------------------|
| `schemaType`    | `String`: This value cannot be`null`. <br />     |
| `propertyPaths` | `Collection`: This value cannot be`null`. <br /> |

|                                                                Returns                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------|--------|
| [GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | <br /> |

**See also:**

- [SearchSpec.Builder.addProjectionPaths(String, Collection)](https://developer.android.com/reference/android/app/appsearch/SearchSpec.Builder#addProjectionPaths(java.lang.String,%20java.util.Collection<android.app.appsearch.PropertyPath>))  

### addProjectionPaths

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  

```
public GetByDocumentIdRequest.Builder addProjectionPaths (String schemaType, 
                Collection<PropertyPath> propertyPaths)
```

Adds property paths for the specified type to be used for projection. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type. If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

If property path is added for the[GetByDocumentIdRequest.PROJECTION_SCHEMA_TYPE_WILDCARD](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest#PROJECTION_SCHEMA_TYPE_WILDCARD), then those property paths will apply to all results, excepting any types that have their own, specific property paths set.

<br />

|                            Parameters                             ||
|-----------------|--------------------------------------------------|
| `schemaType`    | `String`: This value cannot be`null`. <br />     |
| `propertyPaths` | `Collection`: This value cannot be`null`. <br /> |

|                                                                Returns                                                                 ||
|--------------------------------------------------------------------------------------------------------------------------------|--------|
| [GetByDocumentIdRequest.Builder](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest.Builder) | <br /> |

**See also:**

- [SearchSpec.Builder.addProjectionPaths(String, Collection)](https://developer.android.com/reference/android/app/appsearch/SearchSpec.Builder#addProjectionPaths(java.lang.String,%20java.util.Collection<android.app.appsearch.PropertyPath>))  

### build

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

```
public GetByDocumentIdRequest build ()
```

Builds a new[GetByDocumentIdRequest](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest).

<br />

|                                                                      Returns                                                                       ||
|----------------------------------------------------------------------------------------------------------------|------------------------------------|
| [GetByDocumentIdRequest](https://developer.android.com/reference/android/app/appsearch/GetByDocumentIdRequest) | This value cannot be`null`. <br /> |