# AppSearchSchema.BytesPropertyConfig.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/AppSearchSchema.BytesPropertyConfig.Builder "View this page in Java")  

```
class Builder
```

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

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

## Summary

|                                                                                                                                                                                                    Public constructors                                                                                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#Builder(kotlin.String))`(`propertyName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Creates a new[BytesPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#). |

|                                                                                                                                                                                                                                                   Public methods                                                                                                                                                                                                                                                    ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AppSearchSchema.BytesPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig)                  | [build](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#build())`()` Constructs a new[BytesPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig)from the contents of this builder.                           |
| [AppSearchSchema.BytesPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#) | [setCardinality](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#setCardinality(kotlin.Int))`(`cardinality:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the cardinality of the property (whether it is optional, required or repeated). |
| [AppSearchSchema.BytesPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#) | [setDescription](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#setDescription(kotlin.String))`(`description:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Sets a natural language description of this property.                       |

## Public constructors

### Builder

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

```
Builder(propertyName: String)
```

Creates a new[BytesPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig.Builder#).

|                                                          Parameters                                                          ||
|----------------|--------------------------------------------------------------------------------------------------------------|
| `propertyName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

## Public methods

### build

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

```
fun build(): AppSearchSchema.BytesPropertyConfig
```

Constructs a new[BytesPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BytesPropertyConfig)from the contents of this builder.

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

### setCardinality

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

```
fun setCardinality(cardinality: Int): AppSearchSchema.BytesPropertyConfig.Builder
```

Sets the cardinality of the property (whether it is optional, required or repeated).

If this method is not called, the default cardinality is[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL:kotlin.Int).

|                                                                                                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                                                                                                        ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cardinality` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED:kotlin.Int),[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL:kotlin.Int), or[android.app.appsearch.AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED:kotlin.Int) |

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

### setDescription

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

```
fun setDescription(description: String): AppSearchSchema.BytesPropertyConfig.Builder
```

Sets a natural language description of this property.

For more details about the description field, see[android.app.appsearch.AppSearchSchema.PropertyConfig#getDescription](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.PropertyConfig#getDescription()).

|                                                         Parameters                                                          ||
|---------------|--------------------------------------------------------------------------------------------------------------|
| `description` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):This value cannot be`null`. |

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