Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | from abc import ABC |
||
2 | from typing import List |
||
3 | |||
4 | from etlt.condition.Condition import Condition |
||
5 | |||
6 | |||
7 | class CompoundCondition(Condition, ABC): |
||
8 | """ |
||
9 | Abstract parent class for conditions with one or more child conditions. |
||
10 | """ |
||
11 | |||
12 | # ------------------------------------------------------------------------------------------------------------------ |
||
13 | def __init__(self): |
||
14 | """ |
||
15 | Object constructor. |
||
16 | """ |
||
17 | self._conditions: List[Condition] = [] |
||
18 | """ |
||
19 | The list of conditions of this compound condition. |
||
20 | """ |
||
21 | |||
22 | # ------------------------------------------------------------------------------------------------------------------ |
||
23 | def append_condition(self, condition: Condition) -> None: |
||
24 | """ |
||
25 | Appends a child condition to the list of conditions of this compound condition. |
||
26 | |||
27 | :param condition: The child conditions. |
||
28 | """ |
||
29 | self._conditions.append(condition) |
||
30 | |||
32 |