- Enclosing class:
Option
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 ElementsModifier and TypeOptional ElementDescriptionThe optional value specified here will determine the singular form of the method name.booleanWhen set totrue, the prefixaddorputwill be added to generated methods (for collections and maps respectively).
-
Element Details
-
value
String valueThe optional value specified here will determine the singular form of the method name. For instance, if we take a method like this:
an additional generated method named@Singlular("pickle") List<Pickle> getPickles();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:
""
-
withPrefix
boolean withPrefixWhen set totrue, the prefixaddorputwill be added to generated methods (for collections and maps respectively). When set tofalse, thevalue()will be used as a full method name for singular add/put methods.In case you set this to
false, you must make sure the method name does not conflict with other methods on the generated type- Returns:
- whether to add prefix to the generated method, defaults to
true
- Default:
true
-