title: Gson mapping Lat/Lng class
body: <p>My server returns a json object like this:</p>
  
  <pre><code>{
      "sw": {
          "latitude": 12.283139573692,
          "longitude": 76.623518155689
      },
      "ne": {
          "latitude": 12.30112600581,
          "longitude": 76.651167163598
      }
  }
  </code></pre>
  
  <p>And my Gson class is</p>
  
  <pre><code>import com.google.android.gms.maps.model.LatLng;
  
  /**
   * Created by Moz on 12/10/15.
   */
  public class Box {
      LatLng ne;
      LatLng sw;
  
      public LatLng getNorthEast() {
          return ne;
      }
  
      public LatLng getSouthWest() {
          return sw;
      }
  
  }
  </code></pre>
  
  <p>It works fine in this case because the LatLng class under <code>com.google.android.gms.maps.model</code> uses names as latitude, longitude. However, I would rather have my server respond as lat, lng since it saves space when sending large sets of latlng objects. The problem here is that since this LatLng object is part of the Google library I’m unable to add a field map name annotation. I would like to remain using the original google’s LatLng class but at the same time allows the server to return a smaller response i.e. lat, lng. How can this be achieved?</p>