Skip to main content

ConstrainedIntValidator

This class validates integer values against a set of configurable constraints, including strict type checking and range boundaries. It supports enforcing minimum and maximum limits through inclusive or exclusive thresholds, as well as verifying that values are multiples of a specific integer.

Attributes

AttributeTypeDescription
strictboolDetermines whether the validator enforces strict integer type checking or allows coercion from other types.
multiple_of[Int](../../input/return/enums/int.md?sid=input_return_enums_int)Constraint requiring the integer to be a multiple of this specific value.
le[Int](../../input/return/enums/int.md?sid=input_return_enums_int)Inclusive upper bound constraint that requires the integer to be less than or equal to this value.
lt[Int](../../input/return/enums/int.md?sid=input_return_enums_int)Exclusive upper bound constraint that requires the integer to be strictly less than this value.
ge[Int](../../input/return/enums/int.md?sid=input_return_enums_int)Inclusive lower bound constraint that requires the integer to be greater than or equal to this value.
gt[Int](../../input/return/enums/int.md?sid=input_return_enums_int)Exclusive lower bound constraint that requires the integer to be strictly greater than this value.

Constructor

Signature

def ConstrainedIntValidator(
strict: bool = false,
multiple_of: Optional[int] = None,
le: Optional[int] = None,
lt: Optional[int] = None,
ge: Optional[int] = None,
gt: Optional[int] = None
) - > null

Parameters

NameTypeDescription
strictbool = falseWhether to strictly validate the integer type.
multiple_ofOptional[int] = NoneThe value that the input integer must be a multiple of.
leOptional[int] = NoneThe maximum inclusive value (less than or equal to).
ltOptional[int] = NoneThe maximum exclusive value (less than).
geOptional[int] = NoneThe minimum inclusive value (greater than or equal to).
gtOptional[int] = NoneThe minimum exclusive value (greater than).

Signature

def ConstrainedIntValidator(
strict: bool = false,
multiple_of: Optional[int] = None,
le: Optional[int] = None,
lt: Optional[int] = None,
ge: Optional[int] = None,
gt: Optional[int] = None
)

Parameters

NameTypeDescription
strictbool = falseWhether to enforce strict integer type checking and disallow numeric-like strings or floats.
multiple_ofOptional[int] = NoneA value that the input integer must be an exact multiple of.
leOptional[int] = NoneThe inclusive upper bound (less than or equal to) for the input value.
ltOptional[int] = NoneThe exclusive upper bound (less than) for the input value.
geOptional[int] = NoneThe inclusive lower bound (greater than or equal to) for the input value.
gtOptional[int] = NoneThe exclusive lower bound (greater than) for the input value.