Annotation Interface Option.Singular

Enclosing class:
Option

@Target(METHOD) @Retention(CLASS) public static @interface Option.Singular
Applying this annotation to a Prototype.Blueprint-annotated interface method will cause the generated class to also include additional "add*()" methods. This will only apply, however, if the method is for a Map, List, or Set.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The optional value specified here will determine the singular form of the method name.
  • Element Details

    • value

      String value
      The optional value specified here will determine the singular form of the method name. For instance, if we take a method like this:
      
       @Singlular("pickle")
       List<Pickle> getPickles();
       
      an additional generated method named addPickle(Pickle val) will be placed on the builder of the generated class.

      This annotation only applies to getter methods that return a Map, List, or Set. If left undefined then the add method will use the default method name, dropping any "s" that might be present at the end of the method name (e.g., pickles -> pickle).

      Returns:
      The singular name to add
      Default:
      ""