All Downloads are FREE. Search and download functionalities are using the official Maven repository.

framework.annotation.Time Maven / Gradle / Ivy

package framework.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

import framework.AbstractValidator;
import framework.annotation.Validator.ErrorAppender;

/**
 * Time limitation from past to future
 */
@Target({ ElementType.PARAMETER, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Validator(Time.Validator.class)
public @interface Time {
    /**
     * @return apply groups
     */
    Class[] groups() default Valid.All.class;

    /**
     * @return forward offset
     */
    int past() default Integer.MAX_VALUE;

    /**
     * @return backward offset
     */
    int future() default Integer.MAX_VALUE;

    /**
     * @return unit of past and future
     */
    ChronoUnit unit() default ChronoUnit.DAYS;

    /**
     * @return Error message
     */
    String message() default "{Sys.Alert.time}";

    @SuppressWarnings("javadoc")
    class Validator extends AbstractValidator




© 2015 - 2024 Weber Informatics LLC | Privacy Policy