ag.orbia.common.javax.annotations.ZipCode.kt Maven / Gradle / Ivy
package ag.orbia.common.javax.annotations
import ag.orbia.common.javax.validators.alphanumeric.AlphaNumericValidator
import ag.orbia.common.javax.validators.zipcode.ZipCodeValidator
import javax.validation.Constraint
import kotlin.reflect.KClass
/**
* The annotated element must be formatted like a brazilian zipcode.
*
* Valid inputs are formatted as: 00000-000 or 00000000. Eight numbers
* and an optional dash that might be between the fifth and sixth number.
*
* @since 1.0.4
*/
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.RUNTIME)
@Constraint(validatedBy = [ZipCodeValidator::class])
annotation class ZipCode (
val message: String = "O CEP é inválido",
val groups: Array> = [],
val payload: Array> = []
)