title: Can I use Immutables library's Modifiable for Spring Beans?
body: <p>I'm working with a Spring Boot Java API. We have a series of HandlerInterceptorAdapter classes that our API calls move through before they reach the controllers. We have a data object that has its fields set as it moves through these interceptors. This code is owned by many teams, so fundamental changes to this architecture aren't really an option, at least within the scope of this question.</p>
  <p>We currently pass this object through as a Lombok builder, and call build() along the way whenever we need to read fields. This doesn't feel great to me, and in general we're trying to move this project away from Lombok and use the Immutables library.</p>
  <p>Reading the documentation for Modifiable, it seems like that's what I want to use. I've tried creating a bean that is the Modifiable object, but something about the Spring CGLIB class keeps the setter methods from connecting to the Modifiable object itself. It looks to be running correctly, but none of the fields are actually being set.</p>
  <p>FWIW, I also had to configure the Modifiable class as <code>@Value.Style(create = &quot;new&quot;)</code> to keep it from being <code>final</code>.</p>
  <p>I've also tried doing the same thing with an <code>Immutable.Builder</code> class with no luck.</p>
  <p>Is it possible to use the <code>Modifiable</code> library in this way? Conceptually, it seems ideal for this use case.</p>