title: Convert nested POJO or JSON to Map<String, String>
body: <p>In order to create a <strong>multipart/form-data</strong> request, I need to transform either a <strong>nested POJO</strong> or the <strong>nested JSON</strong> that results from Jackson serialization to a <strong>Map&lt;String, String&gt;</strong> with the following format.</p>
  <pre><code>Map&lt;String, String&gt; map = new HashMap&lt;&gt;();
  map.put(&quot;transaction_id&quot;, request.getTransactionId());
  map.put(&quot;person[dob]&quot;, request.getPerson().getDob());
  map.put(&quot;person[first_name]&quot;, request.getPerson().getFirstName());
  map.put(&quot;person[last_name]&quot;, request.getPerson().getLastName());
  </code></pre>
  <p>Here are the definitions of the relevant classes.</p>
  <pre><code>@Getter
  public class Request {
    @JsonProperty(&quot;transaction_id&quot;)
    private String transactionId;
    
    private Person person;
  }
  
  @Getter
  public class Person {
      @JsonProperty(&quot;dob&quot;)
      private String dob;
  
      @JsonProperty(value = &quot;first_name&quot;)
      private String firstName;
  
      @JsonProperty(value = &quot;last_name&quot;)
      private String lastName;
  }
  </code></pre>
  <p>Is there someway to do the map population automatically from a given <code>Request</code> POJO or serialized JSON, e.g. using Jackson that I already use for JSON serialization?</p>