yawning_titan.config.item_types.int_item.IntProperties#
- class yawning_titan.config.item_types.int_item.IntProperties(_allowed_types=None, allow_null=None, default=None, min_val=None, inclusive_min=None, max_val=None, inclusive_max=None, parity=None)[source]#
Bases:
ItemTypeProperties
The IntProperties class holds the properties relevant for defining and validating an int value.
Methods
Serializes the
IntProperties
as a dict.Validates an int against the properties set in
IntProperties
.Attributes
True if the config value can be left empty, otherwise False.
The default value
Indicates whether max_val is exclusive of the value (<=, rather than <).
Indicates whether min_val is exclusive of the value (>=, rather than >).
A maximum int value.
A minimum int value.
The integer parity.
- min_val = None#
A minimum int value.
- inclusive_min = None#
Indicates whether min_val is exclusive of the value (>=, rather than >).
- max_val = None#
A maximum int value.
- inclusive_max = None#
Indicates whether max_val is exclusive of the value (<=, rather than <).
- parity = None#
The integer parity.
- allow_null = None#
True if the config value can be left empty, otherwise False.
- default = None#
The default value
- to_dict()[source]#
Serializes the
IntProperties
as a dict.- Returns:
The
IntProperties
as a dict.
- validate(val)[source]#
Validates an int against the properties set in
IntProperties
.- Parameters:
val – A int to be validated.
- Returns:
An instance of
ConfigItemValidation
.- Raise:
ConfigItemValidationError
when validation fails.