title: How to deserialize interface fields using Jackson's objectMapper?
body: <p><code>ObjectMapper</code>'s <code>readValue(InputStream in, Class&lt;T&gt; valueType)</code> function requires the Class. But how do I use it if the class I am passing internally, is having some Interface as data member. </p>
  
  <p>although I can understand the reason behind this exception, as Jackson is not getting the concrete class of the internal Interface of the passed class, but my question is how to resolve it?
  how do I deserialize it then? The class I am trying to deserialize is:</p>
  
  <pre class="lang-java prettyprint-override"><code>class BaseMetricImpl&lt;N&gt; implements Metric&lt;N&gt; {
      protected MetricValueDescriptor descriptor;
  }
  </code></pre>
  
  <p>Here <code>MetricValueDescriptor</code> is an interface, so this gives me following error : - </p>
  
  <pre class="lang-none prettyprint-override"><code>com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of MetricValueDescriptor, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
   at [Source: java.io.ByteArrayInputStream@2ede2c9f; line: 1, column: 2] (through reference chain: SingleValueMetricImpl["descriptor"])
      at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
      at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:624)
      at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:115)
      at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:375)
      at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:98)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:308)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2793)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1989)
  </code></pre>