I write simple validation annotation for spring project. Problem is that I don't understand some method purpose. Here is my annotation:
@Constraint(validatedBy = PostCodeValidator.class)
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface PostCode {
public String value() default "LUV";
public String message() default "must start with LUV";
public Class<?>[] groups() default {};
public Class<? extends Payload>[] payload() default {};
}
Could anyone explain me groups()
& payload()
method purpose? I'll be very grateful if explanation will be as simple as it possible. Thanks.