# A2uiSchemaKeyword.IfThen

Artifact: [androidx.a2ui:a2ui-model](https://developer.android.com/jetpack/androidx/releases/a2ui) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/model/schema/A2uiSchemaKeyword.kt+class:androidx.a2ui.model.schema.A2uiSchemaKeyword.IfThen) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

*** ** * ** ***


```
class A2uiSchemaKeyword.IfThen : A2uiSchemaKeyword<Nothing>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.a2ui.model.schema.A2uiSchemaKeyword](https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword)\<[Nothing](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-nothing/index.html)\> ||
|   | ↳ | [androidx.a2ui.model.schema.A2uiSchemaKeyword.IfThen](https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen) |

*** ** * ** ***

Conditional subschema applicator (`if`-`then`-`else`).

Note: Standard JSON Schema Draft 2020-12 permits only one `if`-`then`-`else` block per schema node. To apply multiple conditional rules to a single node, wrap multiple `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen` keywords inside an `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.AllOf` list.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#IfThen(androidx.a2ui.model.schema.A2uiSchema,androidx.a2ui.model.schema.A2uiSchema,androidx.a2ui.model.schema.A2uiSchema)( ifSchema: https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema, thenSchema: https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema, elseSchema: https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema? )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema?` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#elseSchema()` optional subschema evaluated if `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` fails |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` condition subschema |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#thenSchema()` subschema evaluated if `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` matches |

## Public constructors

### IfThen

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
IfThen(
    ifSchema: A2uiSchema,
    thenSchema: A2uiSchema,
    elseSchema: A2uiSchema? = null
)
```

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### elseSchema

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val elseSchema: A2uiSchema?
```

optional subschema evaluated if `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` fails

### ifSchema

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val ifSchema: A2uiSchema
```

condition subschema

### thenSchema

Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui#1.0.0-alpha02)

```
val thenSchema: A2uiSchema
```

subschema evaluated if `https://developer.android.com/reference/kotlin/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` matches