# StorageInfo.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

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

## Summary

|                                                     Public constructors                                                     ||
|--------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                     Public methods                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [StorageInfo](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo)                  | [build](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#build())`()` Builds a[StorageInfo](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo)object.                                                                         |
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | [setAliveDocumentsCount](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#setAliveDocumentsCount(kotlin.Int))`(`aliveDocumentsCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the number of alive documents.     |
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | [setAliveNamespacesCount](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#setAliveNamespacesCount(kotlin.Int))`(`aliveNamespacesCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the number of alive namespaces. |
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | [setBlobsCount](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#setBlobsCount(kotlin.Int))`(`blobsCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the number of stored blobs.                                   |
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | [setBlobsSizeBytes](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#setBlobsSizeBytes(kotlin.Long))`(`blobsSizeBytes:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the size of stored blobs in bytes.             |
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | [setSizeBytes](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#setSizeBytes(kotlin.Long))`(`sizeBytes:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the size in bytes.                                            |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
fun build(): StorageInfo
```

Builds a[StorageInfo](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo)object.

|                                                            Return                                                            ||
|-------------------------------------------------------------------------------------------------|-----------------------------|
| [StorageInfo](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo) | This value cannot be`null`. |

### setAliveDocumentsCount

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

```
fun setAliveDocumentsCount(aliveDocumentsCount: Int): StorageInfo.Builder
```

Sets the number of alive documents.

|                                                                    Return                                                                     ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | This value cannot be`null`. |

### setAliveNamespacesCount

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

```
fun setAliveNamespacesCount(aliveNamespacesCount: Int): StorageInfo.Builder
```

Sets the number of alive namespaces.

|                                                                    Return                                                                     ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | This value cannot be`null`. |

### setBlobsCount

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

```
fun setBlobsCount(blobsCount: Int): StorageInfo.Builder
```

Sets the number of stored blobs.

|                                                                    Return                                                                     ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | This value cannot be`null`. |

### setBlobsSizeBytes

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

```
fun setBlobsSizeBytes(blobsSizeBytes: Long): StorageInfo.Builder
```

Sets the size of stored blobs in bytes.

|                                                                    Return                                                                     ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | This value cannot be`null`. |

### setSizeBytes

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

```
fun setSizeBytes(sizeBytes: Long): StorageInfo.Builder
```

Sets the size in bytes.

|                                                                    Return                                                                     ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [StorageInfo.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/StorageInfo.Builder#) | This value cannot be`null`. |