Skip to content

Instantly share code, notes, and snippets.



Last active Aug 26, 2018
What would you like to do?
package com.knoldus.user.annotation;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD, ElementType.FIELD})
@Constraint(validatedBy = PasswordValidation.class)
public @interface Password {
Class<?>[] groups() default {};
String message() default "the password must be 10 character long and must include the 1 numeric digit.";
Class<? extends Payload>[] payload() default {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment