CompoundCondition.__init__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 6
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 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
31
# ----------------------------------------------------------------------------------------------------------------------
32