Skip to main content

MinValueValidator

This class provides validation logic to ensure that a given value is greater than or equal to a specified minimum limit. It functions by comparing the input against a threshold and raising a validation error with a customizable message if the condition is not met.

Attributes

AttributeTypeDescription
messagestring = Ensure this value is greater than or equal to %(limit_value)s.Ensure this value is greater than or equal to %(limit_value)s.
codestring = min_valueThe error code string used to identify the validation failure in raised exceptions.

Constructor

Signature

def MinValueValidator(
limit_value: Any,
message: str = null
) - > null

Parameters

NameTypeDescription
limit_valueAnyThe threshold value that the input must be greater than or equal to.
messagestr = nullAn optional custom error message to override the default.

Methods


compare()

@classmethod
def compare(
a: Any,
b: Any
) - > boolean

Determines if the provided value is strictly less than the specified limit value.

Parameters

NameTypeDescription
aAnyThe input value being validated for a minimum threshold.
bAnyThe limit value that the input must be greater than or equal to.

Returns

TypeDescription
booleanTrue if the input value is less than the limit, indicating a validation failure; otherwise False.