com.nls.validation.NotNullIf Maven / Gradle / Ivy
package com.nls.validation;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = NotNullIfValidator.class)
public @interface NotNullIf {
String fieldName();
String ifFieldName();
String ifFieldValue();
String message() default "This field is required";
Class>[] groups() default {};
Class extends Payload>[] payload() default {};
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@interface List {
NotNullIf[] value();
}
}