TimeValidator
This class provides functionality for validating time-related data based on configurable strictness and specific constraints. It manages precision behavior for microsecond overflows and allows for the enforcement of custom time limits through an optional constraints interface.
Attributes
| Attribute | Type | Description |
|---|---|---|
| strict | bool | Determines whether the validator enforces strict time format adherence or allows for more flexible parsing. |
| constraints | Option< TimeConstraints > = None | Optional set of rules that define the valid range or specific limitations for time values. |
| microseconds_precision | MicrosecondsPrecisionOverflowBehavior | Defines how the validator handles sub-microsecond data and overflow behavior during time resolution. |
Constructor
Signature
def TimeValidator(
strict: bool,
constraints: Option< TimeConstraints >,
microseconds_precision: MicrosecondsPrecisionOverflowBehavior
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| strict | bool | Whether to enforce strict validation rules. |
| constraints | Option< TimeConstraints > | Optional constraints to apply to the time validation. |
| microseconds_precision | MicrosecondsPrecisionOverflowBehavior | Behavior for handling microsecond precision overflow. |
Signature
@staticmethod
def new(
strict: bool,
constraints: Option< TimeConstraints >,
microseconds_precision: MicrosecondsPrecisionOverflowBehavior
) - > [TimeValidator](timevalidator.md?sid=validators_time_timevalidator)
Parameters
| Name | Type | Description |
|---|---|---|
| strict | bool | Whether to enforce strict validation rules during time parsing. |
| constraints | Option< TimeConstraints > | Optional range constraints or specific limits to apply to validated time values. |
| microseconds_precision | MicrosecondsPrecisionOverflowBehavior | Defines how the validator handles microsecond precision and potential overflow scenarios. |