private val validator: Validator<String?> = PasswordValidator()
val isValid = validator("Aa12345678").isEmpty()
Build in Validators
private val passwordValidator: PasswordValidator = PasswordValidator()
private val userNameValidator: UserNameValidator = UserNameValidator()
private val emailValidator: EmailValidator = EmailValidator()
val result = passwordValidator("Aa12345678") + userNameValidator("Adam") + emailValidator("[email protected]")
val isEmailValid = result.contains(EmailValidator.KEY)
repositories {
mavenCentral()
}
dependencies {
implementation("com.adkhambek.pack:validators:${latest_version}")
}