How to bind request params without setters?
<p>I have a simple controller with a GET handler that accepts an object to bind request parameters:</p>

<pre><code>@RestController
@RequestMapping("/test")
public class SampleController {

    @GetMapping
    public SomeResponse find(RequestParams params) {
       // some code
    }

}
</code></pre>

<p>The <code>RequestParams</code> is a simple POJO class:</p>

<pre><code>public class RequestParams  {

    private String param1;
    private String param2;

    // constructor, getter, and setters

}
</code></pre>

<p>Everthing works fine, but I would like to get rid of the setters to make the object immutable to public use. In the <a href="https://docs.spring.io/spring/docs/5.0.2.RELEASE/spring-framework-reference/web.html#mvc-ann-arguments" rel="nofollow noreferrer">documentation</a> for <code>@RequestMapping</code> handler method up to Spring 5.0.2, we read that 
possible valid method arguments are:</p>

<blockquote>
  <p>Command or form objects to bind request parameters to bean properties
  (via setters) <strong>or directly to fields</strong></p>
</blockquote>

<p>Is it possible to somehow override the default Spring Boot configuration so that request parameters are bound to class properties using reflection and not with setters?</p>

<p><strong>Update 2018</strong></p>

<p>In the later versions of Spring's documentation, the quoted statement has been rephrased and no longer contain information about binding request parameters directly to fields.</p>