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

to_dict

Serializes the IntProperties as a dict.

validate

Validates an int against the properties set in IntProperties.

Attributes

allow_null

True if the config value can be left empty, otherwise False.

default

The default value

inclusive_max

Indicates whether max_val is exclusive of the value (<=, rather than <).

inclusive_min

Indicates whether min_val is exclusive of the value (>=, rather than >).

max_val

A maximum int value.

min_val

A minimum int value.

parity

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.