IntValidator
Validator class
This validator allows validating serialized (or deserialized) integer parameter values.
Usage: Let validator = IntValidator()
, then
* validator.validate('3') -> 3
* validator.validate(3) -> 3)
* validator.validate(3.0) -> 3
* validator.validate('false') -> ValueError
* validator.validate('true') -> ValueError
* validator.validate('foo') -> ValueError
Functions
Initialize self. See help(type(self)) for accurate signature.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
min_value | float | -inf | |
max_value | float | inf | |
include_min | bool | True | |
include_max | bool | True | |
allowed_values | List |
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
type_ | Union |
Valitates a value.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
value | Union | The value to validate an instance of `bool`, `int`, `float`, `str` or serilaizable `list`, `dict` |
Return type:
Any |