from abc import ABC, abstractmethod
from typing import Any
[docs]
class IConfigValidator(ABC):
def __init__(self, validate_immediately: bool = True):
self.validate_immediately = validate_immediately
[docs]
@abstractmethod
def validate(self, value: Any) -> bool:
"""Validate the given value."""
pass
[docs]
@abstractmethod
def error_message(self) -> str:
"""Return the error message if validation fails."""
pass