title: Java - Alias for Field Names
body: <p>Say I have an Object:</p>
  
  <pre><code>Object A
      String field1 = "abc";
      String field2 = "xyz";
  </code></pre>
  
  <p>The json for the above is:</p>
  
  <pre><code>{
      "ObjectA": {
        "field1": "abc",
        "field2": "xyz"
      }
  }
  </code></pre>
  
  <p>I was trying to create a new id for the field names before sending the json.  E.g.  "field1" to be called "f1" and "field2" to be called "f2".  So the intended output json is shown below:</p>
  
  <pre><code>{
      "ObjectA": {
        "f1": "abc",
        "f2": "xyz"
      }
  }
  </code></pre>
  
  <p>I am not sure how to do this.  Can the above be done in a clean way?  Thanks for your help and pointers.</p>
  
  <p>I am using gson.</p>