title: Force GSON to use specific constructor
body: <pre><code>public class UserAction {
      private final UUID uuid;
      private String userId;
      /* more fields, setters and getters here */
  
      public UserAction(){
          this.uuid = UUID.fromString(new com.eaio.uuid.UUID().toString());
      }
  
      public UserAction(UUID uuid){
          this.uuid = uuid;
      }
      @Override
      public boolean equals(Object obj) {
          if (obj == null) {
              return false;
          }
          if (getClass() != obj.getClass()) {
              return false;
          }
          final UserAction other = (UserAction) obj;
          if (this.uuid != other.uuid &amp;&amp; (this.uuid == null || !this.uuid.equals(other.uuid))) {
              return false;
          }
          return true;
      }
  
      @Override
      public int hashCode() {
          int hash = 7;
          hash = 53 * hash + (this.uuid != null ? this.uuid.hashCode() : 0);
          return hash;
      }
  }
  </code></pre>
  
  <p>I am using Gson to serilize and deserialize this class. As today I had to add a final UUID in this object. I have no problem serializing. I need to force gson to use <code>public UserAction(UUID uuid)</code> constructor when deserializing. How can I achieve that ?</p>