com.github.ankurpathak.bean.constraints.validator.EndWithAlphaNumericValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of username-validation Show documentation
Show all versions of username-validation Show documentation
Java library for username validation for general use
and with bean validation api.
package com.github.ankurpathak.bean.constraints.validator;
import com.github.ankurpathak.UsernameValidator;
import com.github.ankurpathak.bean.constraints.EndWithAlphaNumeric;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
/**
* Created by ankur on 04-02-2017.
*/
public class EndWithAlphaNumericValidator implements ConstraintValidator {
private EndWithAlphaNumeric config;
@Override
public void initialize(EndWithAlphaNumeric endWithAlphaNumeric) {
this.config = config;
}
@Override
public boolean isValid(String username, ConstraintValidatorContext constraintValidatorContext) {
return UsernameValidator.endWithAlphaNumeric(username);
}
}