Annotation Interface DurationMax
@Documented
@Constraint(validatedBy={})
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(List.class)
@ReportAsSingleViolation
@Incubating
public @interface DurationMax
The annotated
Duration
element must be shorter than or equal to the one constructed as a sum of
nanos()
, millis()
, seconds()
,
minutes()
, hours()
, days()
.- Author:
- Marko Bekhta
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Defines several@DurationMax
annotations on the same element. -
Optional Element Summary
Optional Elements
-
Element Details
-
message
String message- Default:
"{org.hibernate.validator.constraints.time.DurationMax.message}"
-
groups
Class<?>[] groups- Default:
{}
-
payload
- Default:
{}
-
days
long days- Default:
0L
-
hours
long hours- Default:
0L
-
minutes
long minutes- Default:
0L
-
seconds
long seconds- Default:
0L
-
millis
long millis- Default:
0L
-
nanos
long nanos- Default:
0L
-
inclusive
boolean inclusiveSpecifies whether the specified maximum is inclusive or exclusive. By default, it is inclusive.- Returns:
true
if the value must be smaller or equal to the specified maximum,false
if the value must be smaller
- Default:
true
-