Back to bricks list
Introduction
Technical Documentation
Other Classes
BoolValidator Validator
Version

BoolValidator

Validator class.

This validator allows validating serialized (or deserialized) boolean parameter values.

Usage: Let validator = BoolValidator(), then * validator.validate(False) -> False * validator.validate(True) -> True * validator.validate('true') -> True * validator.validate('false') -> False * validator.validate('foo') -> ValueError * validator.validate(4) -> ValueError

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

SET_TYPE
Parameters:
NameTypeDefault valueDescription
type_Union
VALIDATE

Valitates a value.

Parameters:
NameTypeDefault valueDescription
valueUnion The value to validate an instance of `bool`, `int`, `float`, `str` or serilaizable `list`, `dict`
Return type:
Any