Annotation Interface Length


@Retention(RUNTIME) @Target({FIELD,PARAMETER}) public @interface Length
Specifies the exact length that a field or parameter's value must have.

This annotation enforces that the string value of a field or parameter matches the length defined by the length attribute. It is typically used for string-based inputs.

Since:
1.0.0
Version:
1.0.0
Author:
Sandratra NIAINA
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    The exact length that the annotated field or parameter's value must have.
  • Element Details

    • length

      int length
      The exact length that the annotated field or parameter's value must have.
      Returns:
      the required length