Annotation Interface Required


@Retention(RUNTIME) @Target(FIELD) public @interface Required
An annotation to indicate whether a given field is optional, recommended, or mandatory.

Without that annotation, a field is assumed to be RequirementLevel.OPTIONAL. With that annotation, the field is RequirementLevel.MANDATORY, unless the optional isRecommended parameter is set to true, in which case the field is RequirementLevel.RECOMMENDED.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
  • Element Details

    • isRecommended

      boolean isRecommended
      Default:
      false