Package io.dropwizard.validation
Annotation Interface PortRange
@Target({METHOD,FIELD,ANNOTATION_TYPE,TYPE_USE})
@Retention(RUNTIME)
@Constraint(validatedBy=PortRangeValidator.class)
@Documented
public @interface PortRange
A constraint that allows one to specify a port range, but still allow 0 as the port value to
indicate dynamically allocated ports.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass<?>[]
The groups the constraint belongs to.int
The maximum value of the port range the validatedint
must be in.The validation message for this constraint.int
The minimum value of the port range the validatedint
must be in.Class<? extends jakarta.validation.Payload>[]
The payloads of this constraint.
-
Element Details
-
min
int minThe minimum value of the port range the validatedint
must be in.- Returns:
- the minimum value
- Default:
- 1
-
max
int maxThe maximum value of the port range the validatedint
must be in.- Returns:
- the maximum value
- Default:
- 65535
-
message
String messageThe validation message for this constraint.- Returns:
- the message
- Default:
- "{org.hibernate.validator.constraints.Range.message}"
-
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:
- {}
-