Annotation Type RequiredTimeDuration
@Documented
@Constraint(validatedBy=RequiredTimeDurationValidator.class)
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(List.class)
public @interface RequiredTimeDuration
Constraint validation that may be applied to
TimeDuration
. Checks that the duration has a value, i.e. that
TimeDuration.getDuration()
is not null
.
This does not check whether the TimeDuration
instance is non-null, use
NotNull
for that.
- Since:
- 8.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Defines severalRequiredTimeDuration
constraints on the same element. -
Optional Element Summary
Optional Elements
-
Element Details
-
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:
- "{de.xima.fc.validation.constraints.RequiredTimeDuration.message}"
-
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:
- {}
-