> For the complete documentation index, see [llms.txt](https://utca.knowledgator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utca.knowledgator.com/structural-components/switch.md).

# Switch

Subclass of [**Component**](/core/component.md).

## Module: [core](/framework-structure.md#core)

## Methods and properties

Main methods and properties

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* **\***<mark style="color:orange;">**branches**</mark>**&#x20;(**[**Branch**](#branch)**):** Branches that will be used.
* <mark style="color:orange;">**name**</mark>**&#x20;(Optional\[str], optional):** Name for identification. If equals to None, class name will be used. Defaults to None.

***

***

***

## <mark style="color:green;">Branch</mark>

Combination of condition and associated with it Component

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**schema**</mark>**&#x20;(**[**Component**](/core/component.md)**):** Associated Component.
* <mark style="color:orange;">**condition**</mark>**&#x20;(Optional\[**[**ConditionProtocol**](/structural-components/condition.md#conditionprotocol)**], optional):** Associated condition. If equals to None, **schema** always executed. Defaults to None.
* <mark style="color:orange;">**exit\_branch**</mark>**&#x20;(bool, optional):** Specifies that this is the last branch that should be executed. Defaults to **True**.
* <mark style="color:orange;">**name**</mark>**&#x20;(Optional\[str], optional):** Name for identification. If equals to None, class name will be used. Defaults to None.

***

### <mark style="color:blue;">\_\_call\_\_</mark>

Evaluates condition and, if fulfilled, executes schema

#### Arguments:

* <mark style="color:orange;">**input\_data**</mark>**&#x20;(**[**Transformable**](/core/schemas.md#transformable)**):** Data for processing
* <mark style="color:orange;">**evaluator**</mark>**&#x20;(Optional\[**[**Evaluator**](/core/evaluator.md)**], optional):** Evaluator in context of which Condition executed.

#### Returns:

* **Optional\[**[**Transformable**](/core/schemas.md#transformable)**]:** Result of executed **schema**, if executed; otherwise, None.

***

***
