Package io.dropwizard.validation
Annotation Type DataSizeRange
-
@Documented @Constraint(validatedBy={}) @Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(RUNTIME) @MinDataSize(0L) @MaxDataSize(value=9223372036854775807L, unit=PEBIBYTES) @ReportAsSingleViolation public @interface DataSizeRange
The annotated element has to be in the appropriate range. Apply onDataSizeinstances.- Since:
- 2.0
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class<?>[]groupsThe groups the constraint belongs to.longmaxThe maximum value of the range the validatedDataSizemust be in.StringmessageThe validation message for this constraint.longminThe minimum value of the range the validatedDataSizemust be in.Class<? extends jakarta.validation.Payload>[]payloadThe payloads of this constraint.DataSizeUnitunitThe unit of the validated range.
-
-
-
Element Detail
-
min
@OverridesAttribute(constraint=MinDataSize.class, name="value") long min
The minimum value of the range the validatedDataSizemust be in.- Returns:
- the minimum value
- Default:
- 0L
-
-
-
max
@OverridesAttribute(constraint=MaxDataSize.class, name="value") long max
The maximum value of the range the validatedDataSizemust be in.- Returns:
- the maximum value
- Default:
- 9223372036854775807L
-
-
-
unit
@OverridesAttribute(constraint=MinDataSize.class,name="unit") @OverridesAttribute(constraint=MaxDataSize.class,name="unit") DataSizeUnit unit
The unit of the validated range.- Returns:
- the
DataSizeUnit
- Default:
- io.dropwizard.util.DataSizeUnit.BYTES
-
-
-
message
String message
The validation message for this constraint.- Returns:
- the message
- Default:
- "must be between {min} {unit} and {max} {unit}"
-
-
-
groups
Class<?>[] groups
The groups the constraint belongs to.- Returns:
- an array of classes representing the groups
- Default:
- {}
-
-
-
payload
Class<? extends jakarta.validation.Payload>[] payload
The payloads of this constraint.- Returns:
- the array of payload classes
- Default:
- {}
-
-