Annotation Type MaxOccurrences


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface MaxOccurrences
    Annotation that marks an option as being restricted to occurring some maximum number of times (inclusive)

    If you want to specify that the option may only occur at most once then you can use the simpler Once annotation instead.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      int occurrences
      The maximum number of occurrences for this option
    • Element Detail

      • occurrences

        int occurrences
        The maximum number of occurrences for this option

        Zero or negative values are ignored

        Returns:
        Max occurrences (inclusive)
        Default:
        0