Skip to content

[#692] commons-lang3 - Improve ToStringStyle configuration#709

Open
duttonw wants to merge 1 commit into
highsource:masterfrom
duttonw:692_commons-lang_plugin_createToStringMethod_update
Open

[#692] commons-lang3 - Improve ToStringStyle configuration#709
duttonw wants to merge 1 commit into
highsource:masterfrom
duttonw:692_commons-lang_plugin_createToStringMethod_update

Conversation

@duttonw

@duttonw duttonw commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Re-factor toString to allow classes injection which does not need to be available on 'generate'. This allows inlined class usage without needing to build an independent jar to be available prior to generation step.

  -Xcommons-lang : generate toString(), hashCode() and equals() for generated code using Jakarta's common-lang [
	  -Xcommons-lang:ToStringStyle=MULTI_LINE_STYLE
	| -Xcommons-lang:ToStringStyle=DEFAULT_STYLE
	| -Xcommons-lang:ToStringStyle=NO_FIELD_NAMES_STYLE
	| -Xcommons-lang:ToStringStyle=SHORT_PREFIX_STYLE
	| -Xcommons-lang:ToStringStyle=SIMPLE_STYLE
	| -Xcommons-lang:ToStringStyle=NO_CLASS_NAME_STYLE
	| -Xcommons-lang:ToStringStyle=JSON_STYLE
	| -Xcommons-lang:ToStringStyle=<any static final variables inside org.apache.commons.lang3.builder.ToStringStyle following regex ^[A-Z0-9_]+>$
	| -Xcommons-lang:ToStringStyle=<Fully qualified class name of a ToStringStyle subtype>
]
 Note: custom ToStringStyle class is needed if you wish to turn off setUseIdentityHashCode on top of MULTI_LINE_STYLE

Also includes end to end testing for toString.

@duttonw duttonw changed the title [#692] Commons Lang plugin updates: Improve ToStringStyle configuration [#692] commons-lang3 - Improve ToStringStyle configuration Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant