Skip to content

Rename generated element-add methods add2X → addToX (breaking) #443

Backlog

Description

@igel-devin-ai

Summary

The generated builder element-add methods are named add2X (e.g. add2NickNames, add2Sponsoren). The digit-as-word naming (2 for "to") is the same anti-pattern that #416 fixed for @Ignore4BuilderGeneration → @IgnoreForBuilderGeneration. For consistency and readability, the generator should emit addToX instead.

Scope

This is the processor's standard output for collection/map element adds, so it affects every generated builder — user-facing API. The rename should cover:

  • collection element adds: add2NickNames(String) → addToNickNames(String)
  • the keyed map variant: add2Members(key, value) → addToMembers(key, value)
  • all generated overloads, javadoc examples, and the committed codegen/processor DTO builders (regenerated automatically)
  • docs and README examples

Breaking change — no deprecation shim

Decision (per @AndreasIgel): this is an intentional breaking change — no @Deprecated add2X delegate methods kept. Bumping the minor/major version and calling it out in the release notes' Breaking Changes section (see #440) is the migration path. Users migrate by renaming add2X → addToX call sites (mechanical, also automatable via search/replace or an OpenRewrite rule if desired).

Notes

  • addToX is preferred over addX: addX would shadow the DTOs' own adder naming (addParameter) and reads ambiguously against the wholesale setter overloads.
  • Depends on nothing in feat: generate fluent builders for codegen model DTOs (#415) #429 — but after merge, regenerating the committed DTO builders will flip them to the new names automatically.

Related: #416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions