Class MinValidator<T extends Number>
java.lang.Object
io.jmix.flowui.component.validation.AbstractValidator<T>
io.jmix.flowui.component.validation.MinValidator<T>
- All Implemented Interfaces:
Validator<T>
,Consumer<T>
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
@Component("flowui_MinValidator")
@Scope("prototype")
public class MinValidator<T extends Number>
extends AbstractValidator<T>
implements org.springframework.beans.factory.InitializingBean
-
Field Summary
Fields inherited from class io.jmix.flowui.component.validation.AbstractValidator
applicationContext, currentAuthentication, datatypeRegistry, message, messages, substitutor
-
Constructor Summary
ConstructorDescriptionMinValidator
(int min) MinValidator
(int min, String message) Constructor with custom error message. -
Method Summary
Methods inherited from class io.jmix.flowui.component.validation.AbstractValidator
afterPropertiesSet, fireValidationException, fireValidationException, formatValue, getMessage, getTemplateErrorMessage, setApplicationContext, setMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
Field Details
-
min
protected int min -
defaultMessage
-
-
Constructor Details
-
MinValidator
public MinValidator() -
MinValidator
public MinValidator(int min) -
MinValidator
Constructor with custom error message. This message can contain '${value}' and '${min}' keys for formatted output.Example: "Value '${value}' should be greater than or equal to '${min}'".
- Parameters:
min
- min valuemessage
- error message
-
-
Method Details
-
setMin
public void setMin(int min) Sets min value of the range. Min value cannot be less than 0. Default value is 0.Note, min value is included in range. Examples:
value = 0, min = 0 - is valid value = 1, min = 2 - is not valid
- Parameters:
min
- min value
-
getMin
public long getMin()- Returns:
- min value
-
accept
Description copied from interface:Validator
Checks a value.
-