title: Is there a way to make a "generic" json object?
body: <p>Currently I am doing something like that:</p>
  
  <pre><code>public class MyObject{
     public String name;
     //constructor here
  }
  </code></pre>
  
  <p>So, if I serialize it:</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  MyObject o = new MyObject("peter");
  mapper.writeValue(System.out,o);
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>{"name":"peter"}
  </code></pre>
  
  <p>I'd like to make this generic, so class would be:</p>
  
  <pre><code>public class MyObject{
    public String name;
    public String value;
    //constructor here
  }
  </code></pre>
  
  <p>So that this call:</p>
  
  <pre><code> ObjectMapper mapper = new ObjectMapper();
   MyObject o = new MyObject("apple","peter");
   mapper.writeValue(System.out,o);
  </code></pre>
  
  <p>would lead to</p>
  
  <pre><code>{"apple":"peter"}
  </code></pre>
  
  <p>is it possible?</p>