Annotation Interface Hostname


@Documented @Constraint(validatedBy={}) @Target({METHOD,FIELD,ANNOTATION_TYPE}) @Retention(RUNTIME) @Pattern(regexp="^(([\\p{Alnum}]([-\\p{Alnum}]*[\\p{Alnum}])?)\\.)*([\\p{Alpha}]([-\\p{Alnum}]*[\\p{Alnum}])?)$") @ReportAsSingleViolation public @interface Hostname
Validation constraint requiring a String to be a valid DNS hostname (or hostname component).
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
     
    Class<? extends jakarta.validation.Payload>[]
     
  • Element Details

    • message

      String message
      Default:
      "Invalid hostname or hostname component"
    • groups

      Class<?>[] groups
      Default:
      {}
    • payload

      Class<? extends jakarta.validation.Payload>[] payload
      Default:
      {}