projectlombok / lombok

Very spicy additions to the Java programming language.
https://projectlombok.org/
Other
12.92k stars 2.4k forks source link

[FEATURE] let, also, run similar to Kotlin's Any objects #3741

Open gbotka opened 2 months ago

gbotka commented 2 months ago

Describe the feature https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/let.html https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/also.html https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/run.html

These generated functions reduce boilerplate and allow function references for mutation.

var something = new Something();
return z(y(x(something)));
var something = new Something();
return something
              .apply(this::x)
              .apply(this::y)
              .let(this::z);

Describe the target audience Everybody who likes to use function references and likes more readable code.