# 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)

*** ** * ** ***


```
public final class A2uiSchemaKeyword.IfThen extends A2uiSchemaKeyword<@NonNull Void>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.a2ui.model.schema.A2uiSchemaKeyword](https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [Void](https://developer.android.com/reference/java/lang/Void.html)\> ||
|   | ↳ | [androidx.a2ui.model.schema.A2uiSchemaKeyword.IfThen](https://developer.android.com/reference/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/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen` keywords inside an `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.AllOf` list.

## Summary

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#getElseSchema()()` optional subschema evaluated if `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` fails |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#getIfSchema()()` condition subschema |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchema` | `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#getThenSchema()()` subschema evaluated if `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#ifSchema()` matches |
| `int` | `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/a2ui/model/schema/A2uiSchemaKeyword.IfThen#toString()()` |

## Public constructors

### IfThen

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

```
public IfThen(
    @NonNull A2uiSchema ifSchema,
    @NonNull A2uiSchema thenSchema,
    A2uiSchema elseSchema
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getElseSchema

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

```
public final A2uiSchema getElseSchema()
```

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

### getIfSchema

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

```
public final @NonNull A2uiSchema getIfSchema()
```

condition subschema

### getThenSchema

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

```
public final @NonNull A2uiSchema getThenSchema()
```

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

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```