content: package org.alien4cloud.tosca.model.templates;
  
  import java.util.Map;
  
  import org.elasticsearch.annotation.MapKeyValue;
  import org.elasticsearch.annotation.ObjectField;
  
  import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
  import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  
  import alien4cloud.json.deserializer.AttributeDeserializer;
  import alien4cloud.json.deserializer.PropertyValueDeserializer;
  import org.alien4cloud.tosca.model.definitions.AbstractPropertyValue;
  import org.alien4cloud.tosca.model.definitions.DeploymentArtifact;
  import org.alien4cloud.tosca.model.definitions.IValue;
  import org.alien4cloud.tosca.model.definitions.Interface;
  import alien4cloud.utils.jackson.ConditionalAttributes;
  import alien4cloud.utils.jackson.ConditionalOnAttribute;
  import alien4cloud.utils.jackson.JSonMapEntryArrayDeSerializer;
  import alien4cloud.utils.jackson.JSonMapEntryArraySerializer;
  import lombok.AllArgsConstructor;
  import lombok.Getter;
  import lombok.NoArgsConstructor;
  import lombok.Setter;
  import org.elasticsearch.annotation.StringField;
  import org.elasticsearch.annotation.query.TermFilter;
  import org.elasticsearch.mapping.IndexType;
  
  /**
   * Abstract template is parent of {@link NodeTemplate} and {@link RelationshipTemplate}.
   */
  @Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  public abstract class AbstractInstantiableTemplate extends AbstractTemplate {
      /**
       * Attributes of the node template
       */
      @ObjectField(enabled = false)
      @ConditionalOnAttribute(ConditionalAttributes.REST)
      @JsonDeserialize(using = JSonMapEntryArrayDeSerializer.class, contentUsing = AttributeDeserializer.class)
      @JsonSerialize(using = JSonMapEntryArraySerializer.class)
      private Map<String, IValue> attributes;
  
      /**
       * The deployment artifacts
       */
      @MapKeyValue
      @ConditionalOnAttribute(value = { ConditionalAttributes.ES_1_2 })
      @JsonDeserialize(using = JSonMapEntryArrayDeSerializer.class)
      @JsonSerialize(using = JSonMapEntryArraySerializer.class)
      private Map<String, DeploymentArtifact> artifacts;
  
      /**
       * The interfaces that are defined at the template level (overriding type's one).
       */
      @MapKeyValue
      @ConditionalOnAttribute(value = { ConditionalAttributes.REST, ConditionalAttributes.ES_1_2 })
      private Map<String, Interface> interfaces;
  }