ats_utilities.checker.ichecker module

Module

ichecker.py

Copyright

Copyright (C) 2017 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com> ats_utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ats_utilities is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Info

Defines abstract class IChecker with attribute(s) and method(s). Creates an interface for Checker and other checker implementations.

class ats_utilities.checker.ichecker.ErrorChecker(value)[source]

Bases: int, Enum

Defines class ErrorChecker with attribute(s). Marks error types for the Checker.

It defines:

attributes:
NO_ERROR - Marks no param error report (0).
TYPE_ERROR - Marks type param error report (1).
FORMAT_ERROR - Marks wrong format error report (2).
methods:

None

FORMAT_ERROR = 2
NO_ERROR = 0
TYPE_ERROR = 1
class ats_utilities.checker.ichecker.IChecker[source]

Bases: ABC

Defines abstract class IChecker with attribute(s) and method(s). Creates an interface for Checker and other checker implementations.

It defines:

attributes:
ERRORS - Marks error types for message reports (0 | 1 | 2).
methods:
validates_parameters - Validates parameters for method(s) or function(s).
is_initialized - Checks if checker component is initialized.
__str__ - Returns the checker as string representation.
ERRORS

alias of ErrorChecker

_abc_impl = <_abc._abc_data object>
abstractmethod is_initialized() bool[source]

Checks if checker component is initialized.

Returns:

True (success) | False (fail)

Return type:

<bool>

Exceptions:

NotImplementedError.

abstractmethod validates_parameters(parameters: list[tuple[str, Any]] | None) tuple[str, int][source]

Validates parameters for a method(s) or function(s).

Parameters:

parameters (<ParametersSpecs | None>) – Specification for parameters

Returns:

Tuple of error message report and error id

Return type:

<ValidationResult>

Exceptions:

NotImplementedError.