package me.chyxion.tigon.validation.annotation;

import javax.validation.Payload;
import javax.validation.Constraint;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import javax.validation.constraints.NotNull;
import java.lang.annotation.RetentionPolicy;
import me.chyxion.tigon.validation.validator.NotNullOrBlankValidator;

/**
 * Mark Field Not Null Or Blank (For String)
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Oct 9, 2016 11:17:43 AM
 */
@NotNull
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
@Constraint(validatedBy = NotNullOrBlankValidator.class)
public @interface NotNullOrBlank {
    String message() default "{me.chyxion.tigon.validation.validator.NotNullOrBlank.message}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
