Annotation Interface Buildable


@Target({CONSTRUCTOR,TYPE}) @Retention(SOURCE) public @interface Buildable
An annotation that triggers the generation of a Builder. The annotation may be added to either the type or constructor. When added to a constructor all fields of the constructor will be exposed to the builder. Additionally, fields (both declared and inherited) that are writeable via setter will be taken into account. To exclude fields from the builder you can use the `ignore` property. When the annotation is added to interfaces or abstract classes, fluent interfaces and implementation will be generated but no builder. Buildable classes that extend, implement buildable abstract classes or interfaces respectively will reuse the generated fluent types. Generic fields are meant to be processed at the level they are resolved.
  • Element Details

    • editableEnabled

      boolean editableEnabled
      Default:
      true
    • validationEnabled

      boolean validationEnabled
      Default:
      false
    • lazyCollectionInitEnabled

      boolean lazyCollectionInitEnabled
      Default:
      true
    • lazyMapInitEnabled

      boolean lazyMapInitEnabled
      Default:
      true
    • generateBuilderPackage

      boolean generateBuilderPackage
      Default:
      false
    • builderPackage

      String builderPackage
      Default:
      "io.sundr.builder"
    • refs

      Default:
      {}
    • inline

      Inline[] inline
      Default:
      {}
    • ignore

      String[] ignore
      Properties to ignore In most cases the sturcture of the class will designate the properties to expose to the builder. However, there might be cases that we need to explicitly request a field not to be exposed. Example: Extending a 3rd party class that exposes setters, or requiring setter for a field that the builder should not expose). In such cases `ignore` can be used.
      Returns:
      the names of the properties to ignore.
      Default:
      {}