org.vfd.springboot.validations.validators.TextValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of springboot-utils Show documentation
Show all versions of springboot-utils Show documentation
Utilities for Spring Boot App
The newest version!
package org.vfd.springboot.validations.validators;
import org.springframework.beans.factory.annotation.Configurable;
import org.vfd.springboot.validations.annotations.Text;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
@Configurable
public class TextValidator implements ConstraintValidator {
@Override
public boolean isValid(String val, ConstraintValidatorContext constraintValidatorContext) {
if (val == null) return false;
return val.matches("^[A-Za-z]{2,}");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy