# AppSearchSchema.BooleanPropertyConfig.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.BooleanPropertyConfig.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.BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#) |

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

## Summary

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

|                                                                                                                                                                                                                                                      Public methods                                                                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AppSearchSchema.BooleanPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig)                  | [build](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#build())`()` Constructs a new[BooleanPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig)from the contents of this builder.                       |
| [AppSearchSchema.BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#) | [setCardinality](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.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.BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#) | [setDescription](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.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.                       |
| [AppSearchSchema.BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#) | [setScoringEnabled](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#setScoringEnabled(kotlin.Boolean))`(`scoringEnabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets the property enabled or disabled for scoring.              |

## 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[BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.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.BooleanPropertyConfig
```

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

|                                                                                      Return                                                                                      ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [AppSearchSchema.BooleanPropertyConfig](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig) | 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.BooleanPropertyConfig.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.BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.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.BooleanPropertyConfig.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.BooleanPropertyConfig.Builder](https://developer.android.com/reference/kotlin/android/app/appsearch/AppSearchSchema.BooleanPropertyConfig.Builder#) | This value cannot be`null`. |

### setScoringEnabled

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 setScoringEnabled(scoringEnabled: Boolean): AppSearchSchema.BooleanPropertyConfig.Builder
```

Sets the property enabled or disabled for scoring.

If this method is not called, the default value is false.

If enabled, it can be used in the advanced ranking expression via the function of 'getScorableProperty'.

For the detailed documentation, see[android.app.appsearch.SearchSpec.Builder#setRankingStrategy(java.lang.String)](https://developer.android.com/reference/kotlin/android/app/appsearch/SearchSpec.Builder#setRankingStrategy(kotlin.String)).

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