Annotation Interface Group


@Target(METHOD) @Retention(CLASS) public @interface Group
This annotation can be used on any injector callback to define a value for total required injections across multiple callbacks. Much like Inject.require() it can be used to treat an injection failure as a critical error, however the require value specified applies to all injectors in the group. This can be used, for example, for 'surrogate' injectors where multiple injectors exist but only one is expected to succeed.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    Maximum allowed injections for this injector group
    int
    Minimum required injections for this injector group
    The name of the injector group, any string
  • Element Details

    • name

      String name
      The name of the injector group, any string
      Returns:
      group name
      Default:
      ""
    • min

      int min
      Minimum required injections for this injector group
      Returns:
      required min value
      Default:
      -1
    • max

      int max
      Maximum allowed injections for this injector group
      Returns:
      allowed max value
      Default:
      -1