Annotation Interface UDPPort
@Documented
@Retention(RUNTIME)
@Target({METHOD,FIELD,PARAMETER,TYPE_USE})
@Constraint(validatedBy=Validator.class)
public @interface UDPPort
Validates that a number looks like a UDP port. Always accepts
null
.- Author:
- Donal Fellows
-
Optional Element Summary
Optional Elements -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The maximum UDP port number.static final int
The minimum ordinary UDP port number.
-
Field Details
-
MIN_UDP_PORT
static final int MIN_UDP_PORTThe minimum ordinary UDP port number.- See Also:
-
MAX_UDP_PORT
static final int MAX_UDP_PORTThe maximum UDP port number.- See Also:
-
-
Element Details
-
any
boolean anyWhether to allow the "any" port. Note that this is not the same as allowing any other port; it's more that it isn't bound to a specific port.- Returns:
- Whether 0 is allowed.
- Default:
- false
-
system
boolean systemWhether to allow system ports.- Returns:
- Whether 1-1023 is allowed.
- Default:
- false
-
ephemeral
boolean ephemeralWhether to allow ephemeral ports.- Returns:
- Whether 32768-65535 is allowed
- Default:
- true
-
message
String messageMessage on constraint violated.- Returns:
- Message
- Default:
- "${validatedValue} is a bad UDP port"
-