# AppSearchSchema.PropertyConfig

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/app/AppSearchSchema.java+class:androidx.appsearch.app.AppSearchSchema.PropertyConfig) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
abstract class AppSearchSchema.PropertyConfig
```

<br />

Known direct subclasses [AppSearchSchema.BlobHandlePropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.BlobHandlePropertyConfig), [AppSearchSchema.BooleanPropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.BooleanPropertyConfig), [AppSearchSchema.BytesPropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.BytesPropertyConfig), [AppSearchSchema.DocumentPropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.DocumentPropertyConfig), [AppSearchSchema.DoublePropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.DoublePropertyConfig), [AppSearchSchema.EmbeddingPropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig), [AppSearchSchema.LongPropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.LongPropertyConfig), [AppSearchSchema.StringPropertyConfig](https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.BlobHandlePropertyConfig` | Configuration for a property of type `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchBlobHandle` in a Document. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.BooleanPropertyConfig` | Configuration for a property containing a boolean. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.BytesPropertyConfig` | Configuration for a property containing a byte array. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.DocumentPropertyConfig` | Configuration for a property containing another Document. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.DoublePropertyConfig` | Configuration for a property containing a double-precision decimal number. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.EmbeddingPropertyConfig` | Configuration for a property of type `https://developer.android.com/reference/kotlin/androidx/appsearch/app/EmbeddingVector` in a Document. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.LongPropertyConfig` | Configuration for a property containing a 64-bit integer. |
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.StringPropertyConfig` | Configuration for a property of type String in a Document. |

*** ** * ** ***

Common configuration for a single property (field) in a Document.

For example, an `EmailMessage` would be a type and the `subject` would be a property.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_OPTIONAL() = 2` Zero or one value \[0,1\]. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_REPEATED() = 1` Any number of items (including zero) \[0...\*\]. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#CARDINALITY_REQUIRED() = 3` Exactly one value \[1\]. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getCardinality()()` Returns the cardinality of the property (whether it is optional, required or repeated). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `@https://developer.android.com/reference/kotlin/androidx/appsearch/app/ExperimentalAppSearchApi https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getDescription()()` Returns a natural language description of this property. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#getName()()` Returns the name of this property. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSchema.PropertyConfig#toString()()` |

## Constants

### CARDINALITY_OPTIONAL

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
const val CARDINALITY_OPTIONAL = 2: Int
```

Zero or one value \[0,1\].

### CARDINALITY_REPEATED

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
const val CARDINALITY_REPEATED = 1: Int
```

Any number of items (including zero) \[0...\*\].

### CARDINALITY_REQUIRED

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
const val CARDINALITY_REQUIRED = 3: Int
```

Exactly one value \[1\].

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```

### getCardinality

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getCardinality(): Int
```

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

### getDescription

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
@ExperimentalAppSearchApi
fun getDescription(): String
```

Returns a natural language description of this property.

Ex. The description for the "homeAddress" property of a "Person" type could be "the address at which this person lives".

This information is purely to help apps consuming this type the semantic meaning of its properties. This field has no effect in AppSearch - it is just stored with the AppSearchSchema. If the description is not set, then this method will return an empty string.

### getName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getName(): String
```

Returns the name of this property.

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```