Annotation Interface NotStartOrEndWithSpace


@Constraint(validatedBy=NotStartOrEndWithSpaceValidator.class) @Retention(RUNTIME) @Target({FIELD,TYPE_USE}) public @interface NotStartOrEndWithSpace
The annotated element must not start or end with a whitespace. Accepts only string.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
     
    boolean
    Specifies whether the value can be empty.
    Class<? extends jakarta.validation.Payload>[]
     
  • Element Details

    • message

      String message
      Default:
      "String must not start or end with a space"
    • optional

      boolean optional
      Specifies whether the value can be empty.
      Default:
      false
    • groups

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

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