# Switch

Subclass of [**Component**](https://utca.knowledgator.com/core/component).

## Module: [core](https://utca.knowledgator.com/framework-structure#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**](https://utca.knowledgator.com/core/component)**):** Associated Component.
* <mark style="color:orange;">**condition**</mark>**&#x20;(Optional\[**[**ConditionProtocol**](https://utca.knowledgator.com/condition#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**](https://utca.knowledgator.com/core/schemas#transformable)**):** Data for processing
* <mark style="color:orange;">**evaluator**</mark>**&#x20;(Optional\[**[**Evaluator**](https://utca.knowledgator.com/core/evaluator)**], optional):** Evaluator in context of which Condition executed.

#### Returns:

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

***

***
