Maybe I'm not using lombok the right way, but I have this problem.
I love to use the @AllArgsConstructor(onConstructor = @__(@Inject)) when working with Guice. However, once I need to inject @Named properties (tipically configuration Strings, I need to remove the @AllArgsConstructor(onConstructor = @__(@Inject))
and type a constructor like
@Inject
public MyClass(MyDependency dependency, @Named("project.version") String projectVersion) {
this.dependency = dependency;
this.projectVersion = projectVersion;
}
I think it would be nicer to be able to write
@AllArgsConstructor(onConstructor = @__(@Inject), copyFieldAnnotationsToConstructorParams=true)
class MyClass{
private final MyDependency dependency;
private final @Named("project.version") String projectVersion;
}
And gt he constructor automatically generated. At the very least, it will help Guice users like myself.
Thanks again for this awesome addition to Java