Skip to content

Instantly share code, notes, and snippets.

@bhawna94
Last active April 30, 2019 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhawna94/3602a354126561a32f535509e4064711 to your computer and use it in GitHub Desktop.
Save bhawna94/3602a354126561a32f535509e4064711 to your computer and use it in GitHub Desktop.
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.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = FutureAndWithinSevenDaysValidator.class)
public @interface FutureAndWithinSevenDays {
String message() default "The date should be future or within the seven days period.";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment