Package io.dropwizard.validation
Annotation Interface MaxDataSize
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy=MaxDataSizeValidator.class)
public @interface MaxDataSize
The annotated element must be a
DataSize
whose value must be less than or equal to the specified maximum.
null
elements are considered valid- Since:
- 2.0
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
value
long valueThe annotation's value.- Returns:
- value the element must be less than or equal to
-
-
-
message
String messageThe validation message for this constraint.- Returns:
- the message
- Default:
- "must be less than or equal to {value} {unit}"
-
groups
Class<?>[] groupsThe groups the constraint belongs to.- Returns:
- an array of classes representing the groups
- Default:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payloadThe payloads of this constraint.- Returns:
- the array of payload classes
- Default:
- {}
-
unit
DataSizeUnit unitThe unit of the annotation.- Returns:
- unit of the value the element must be less than or equal to
- Default:
- BYTES
-