See here: http://fasterxml.github.io/jackson-annotations/javadoc/2.4/com/fasterxml/jackson/annotation/JsonTypeInfo.html
Basically, this states that when encoding/decoding from JSON, the "type" field is used to determine which subclass of StoragePluginConfig should be materialized. It also says to store the "type" field as a property inside the object to be serialized/deserialized. (Note, another option is to hold this in a separate container as a WRAPPER_OBJECT). Interface: probably(?) Initially there were certain bugs inside of Jackson that caused issues when using interfaces for certain things. (As a side commentary, my sense is that people have started moving away from interfaces in java and towards abstract classes since enhancements can be given default implementations rather than breaking downstream projects. We saw this extensively in the move from Hadoop 1 to Hadoop 2. As such, I think we should be cautious about when and if we use interfaces.) On Mon, Jul 13, 2015 at 11:33 AM, Daniel Barclay <[email protected]> wrote: > What exactly does the following Jackson @JsonTypeInfo annotation on > org.apache.drill.common.logical.StoragePluginConfig do?: > > > @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = > JsonTypeInfo.As.PROPERTY, property="type") > public abstract class StoragePluginConfig { > > > Also, would that annotation still have the desired effect if > StoragePluginConfig were an interface? > > > Daniel > -- > Daniel Barclay > MapR Technologies >
