Package lombok

Annotation Type Singular


@Target({FIELD,PARAMETER})
@Retention(SOURCE)
public @interface Singular
The singular annotation is used together with @Builder to create single element 'add' methods in the builder for collections.
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    boolean ignoreNullCollections  
    java.lang.String value  
  • Element Details

    • value

      java.lang.String value
      Returns:
      The singular name of this field. If it's a normal english plural, lombok will figure it out automatically. Otherwise, this parameter is mandatory.
      Default:
      ""
    • ignoreNullCollections

      boolean ignoreNullCollections
      Returns:
      If true, the plural variant (which takes a collection and adds each element inside) will treat null as an empty collection, i.e. do nothing. If false (the default), it is null checked as if annotated with @lombok.NonNull.
      Default:
      false