Annotation Type ProvidesIntoOptional

  • @Documented
    public @interface ProvidesIntoOptional
    Annotates methods of a Module to add items to a Multibinder. The method's return type and binding annotation determines what Optional this will contribute to. For example,
     String provideFooUrl(FooManager fm) { return fm.getUrl(); }
     String provideBarUrl(BarManager bm) { return bm.getUrl(); }
    will set the default value of @Named("url") Optional<String> to foo's URL, and then override it to bar's URL.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      ProvidesIntoOptional.Type value
      Specifies if the binding is for the actual or default value.