title: Convert LinkedHashMap<String,String> to an object in Java
body: <p>I'll start directly with my question and later on I give more background information. </p>
  
  <p><strong>Simple</strong>: I hava a <code>LinkedHashMap&lt;String, String&gt;</code> and it represents a specific object. 
  What is the best way to convert it to that object? </p>
  
  <p>I know that you can use generics to get through all elements and set the fields, but what is whit nested objects? </p>
  
  <p><strong>Background</strong>: I have a JAX-RS service that consumes JSON objects. My service handles different kind of objects and just represents an interface. So I don't know which objects are coming from outside and which program is using my service. </p>
  
  <p>At runtime I get the information via <code>@Inject</code> on my interface. The JAX-RS service stores the data from the client in an untyped Object and its done automatically (thats the <code>LinkedHashMap&lt;String, String&gt;</code>). </p>
  
  <p>With my interface I want to provide a method like <code>setObject</code> and parameter should be a object of that type. I can handle all of this, but not the part where I convert the Object <code>LinkedHashMap&lt;String, String&gt;</code> to that specific object. </p>
  
  <p><strong>Example Structure</strong>:
  Target Objects could like that</p>
  
  <pre><code>public class Document {
      private String title;
      private String id;
      private int version;
  }
  </code></pre>
  
  <p>The <code>LinkedHashMap</code> looks like that</p>
  
  <pre><code>{title=some title, id=1, version=1}
  </code></pre>