1

I code in Kotlin mostly, but I also work on a project written in Java

I would like to use the Immutables library to avoid writing boilerplate code

I'm used to accessing my data class fields without any getters (e.g. config.value instead of config.getValue())

I cannot figure out how to do that with the immutables library. It keeps making private final fields

Is there a way to enable generating public final fields?

Larik Borts
  • 353
  • 1
  • 3
  • 8
  • Can you provide a small code snippet? It'll make it easier for others to answer your question. – j4ckofalltrades Nov 22 '20 at 13:17
  • I'm not sure it's possible to make Immutables work on public, final fields instead of getter-methods, but you can at least remove the `get`-prefix from these methods through configuration: http://immutables.github.io/style.html – Henrik Aasted Sørensen Nov 23 '20 at 13:02

0 Answers0