Annotation Interface FutureOrPresent


The annotated element must be an instant, date or time in the present or in the future.

Now is defined by the Clock Supplier attached to the

invalid @link
Validator
. The default supplier defines the current time according to the virtual machine, applying the current default time zone if needed.

The notion of present here is defined relatively to the type on which the constraint is used. For instance, if the constraint is on a

invalid @link
Year
, present would mean the whole current year.

Supported types are:

  • java.util.Date
  • java.util.Calendar
  • java.time.Instant
  • java.time.LocalDate
  • java.time.LocalDateTime
  • java.time.LocalTime
  • java.time.MonthDay
  • java.time.OffsetDateTime
  • java.time.OffsetTime
  • java.time.Year
  • java.time.YearMonth
  • java.time.ZonedDateTime

null elements are considered valid.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Defines several @FutureOrPresent constraints on the same element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
     
  • Element Details

    • message

      String message
      Default:
      "{avaje.FutureOrPresent.message}"
    • groups

      Class<?>[] groups
      Default:
      {}