title: fasterxml serialize using toString and deserialize using String constructor
body: <p>I have a POJO which looks something like this:</p>
  
  <pre><code>public class Thing
  {
     private final int x;
     private final int y;
     private final int z;
  
     public Thing(String strThing)
     {
         // parse strThing which is in some arbitrary format to set x, y and z
     }
  
     @Override
     public String toString()
     {
         // return a string representation of thing
         // (same format as that parsed by the constructor)
     }
  
     @Override
     public boolean equals(Object obj) ...
  
     @Override
     public int hashCode() ...
  
  }
  </code></pre>
  
  <p>and I want to use it as a key for a map (e.g. <code>HashMap&lt;Thing, SomeOtherPOJO&gt;</code>) which, when serializing to json, uses the toString() representation of Thing for the key, and when deserializing, uses the String constructor. Is this possible using something simple like jackson databind annotations? What would be the best way to tackle this?</p>