All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ankurpathak.bean.constraints.validator.StartWithAlphaNumericValidator Maven / Gradle / Ivy

Go to download

Java library for username validation for general use and with bean validation api.

There is a newer version: 1.4.0
Show newest version
package com.github.ankurpathak.bean.constraints.validator;


import com.github.ankurpathak.UsernameValidator;
import com.github.ankurpathak.bean.constraints.StartWithAlphaNumeric;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * Created by ankur on 04-02-2017.
 */
public class StartWithAlphaNumericValidator implements ConstraintValidator {

    private StartWithAlphaNumeric config;

    @Override
    public void initialize(StartWithAlphaNumeric config) {
        this.config = config;
    }

    @Override
    public boolean isValid(String username, ConstraintValidatorContext constraintValidatorContext) {
        return UsernameValidator.startWithAlphaNumeric(username);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy