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 Details

    • min

      protected int min
    • defaultMessage

      protected String defaultMessage
  • Constructor Details

    • MinValidator

      public MinValidator()
    • MinValidator

      public MinValidator(int min)
    • MinValidator

      public MinValidator(int min, String message)
      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 value
      message - 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

      public void accept(@Nullable T value) throws ValidationException
      Description copied from interface: Validator
      Checks a value.
      Specified by:
      accept in interface Consumer<T extends Number>
      Specified by:
      accept in interface Validator<T extends Number>
      Parameters:
      value - a value
      Throws:
      ValidationException