Skip to content

Rename setterSuffix option: it is applied as a prefix, not a suffix #342

Closed

Description

@igel-devin-ai

Problem

The configuration option setterSuffix is misleadingly named: it is applied as a prefix, not a suffix.

MethodGeneratorUtil.generateBuilderMethodName produces setterSuffix + capitalize(fieldName), so setterSuffix = "with" generates withName(...), withNameUpdate(...) — never nameWith(...).

The documentation already describes prefix semantics ("Adds a prefix to all setter method names", -Asimplebuilder.setterSuffix=customPrefix), so only the option name is wrong — but it is confusing enough that it caused a real bug in #312, where the MapStruct naming strategy initially derived <field><suffix> names that could never match a generated setter.

Where the name appears

  • @SimpleBuilder.Options#setterSuffix() (annotation element)
  • BuilderConfiguration.Builder#setterSuffix / BuilderConfiguration#getSetterSuffix()
  • Compiler argument -Asimplebuilder.setterSuffix (CompilerArgumentsEnum.SETTER_SUFFIX)
  • docs/CONFIGURATION.md and generated javadoc

Decision (per maintainer)

Hard rename — no compatibility alias. The project has not hit 1.0, so the clean break is acceptable: existing user configs fail loudly on the unknown option rather than silently changing behaviour later.

Proposal

Rename the option to setterPrefix across annotation element, configuration API, compiler argument (-Asimplebuilder.setterPrefix) and docs, removing setterSuffix entirely.

Surfaced in #312 (MapStruct integration, fixes #300).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions