Annotation Type MaxTimeDuration
@Documented
@Constraint(validatedBy=MaxTimeDurationValidator.class)
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(List.class)
public @interface MaxTimeDuration
Constraint validation that may be applied to
TimeDuration
. Checks that the duration is not shorter than the
specified Maximum duration.- Since:
- 8.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Defines severalMaxTimeDuration
constraints on the same element. -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionlong
The maximum duration in the specified unit of time. -
Optional Element Summary
Optional Elements
-
Element Details
-
value
long valueThe maximum duration in the specified unit of time. The unit of time are seconds.- Returns:
- The maximum duration in the specified unit of time.
-
-
-
groups
Class<?>[] groups- Returns:
- Allows the specification of validation groups, to which this constraint belongs. When not specified, the
constraint is placed in the
Default
group.
- Default:
- {}
-
message
String messageGets the key for creating error messages in case the constraint is violated. When not empty, takes precedence over all other message keys.- Returns:
- The default key for creating error messages in case the constraint is violated.
- Default:
- ""
-
messageDays
String messageDays- Returns:
- The key for creating error messages in case the maximum duration is given in days.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.days}"
-
messageHours
String messageHours- Returns:
- The key for creating error messages in case the maximum duration is given in hours.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.hours}"
-
messageMicroseconds
String messageMicroseconds- Returns:
- The key for creating error messages in case the maximum duration is given in microseconds.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.microseconds}"
-
messageMilliseconds
String messageMilliseconds- Returns:
- The key for creating error messages in case the maximum duration is given in milliseconds.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.milliseconds}"
-
messageMinutes
String messageMinutes- Returns:
- The key for creating error messages in case the maximum duration is given in minutes.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.minutes}"
-
messageNanoseconds
String messageNanoseconds- Returns:
- The key for creating error messages in case the maximum duration is given in nanoseconds.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.nanoseconds}"
-
messageSeconds
String messageSeconds- Returns:
- The key for creating error messages in case the maximum duration is given in seconds.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.seconds}"
-
messageWeeks
String messageWeeks- Returns:
- The key for creating error messages in case the maximum duration is given in weeks.
- Default:
- "{de.xima.fc.validation.constraints.MaxTimeDuration.message.weeks}"
-
payload
Class<? extends javax.validation.Payload>[] payload- Returns:
- The payload that can be used by clients of the Jakarta Bean Validation API to assign custom payload objects to a constraint.
- Default:
- {}
-
unit
ETimeUnit unit- Returns:
- The unit of time for the maximum duration.
- Default:
- SECONDS
-