package it.enea.cruise.model.structure;

import java.util.HashMap;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class ColumnCommentDTO {

	
	private List<DescriptionDTO> description;
	
	@JsonIgnore
	private HashMap<String, DescriptionDTO> descriptionOrdered = new HashMap<String, DescriptionDTO>();
	
	private String example;
	
	private String unitOfMeasure;
	
	public void setDescription(List<DescriptionDTO> description) {
		this.description = description;
		for (DescriptionDTO td : description) {
			String language = td.getLang();
			descriptionOrdered.put(language, td);
		}
		
	}
	
	@JsonProperty("protected") 
	private boolean columnProtected;
}
