package com.ejie.ad74a.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.context.i18n.LocaleContextHolder;

import com.ejie.ad74a.constantes.Constantes;
import com.ejie.x38.serialization.JsonDateDeserializer;
import com.ejie.x38.serialization.JsonDateSerializer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * MaestroTiposDoc generated by UDA, 22-mar-2023 17:10:15.
 * 
 * @author UDA
 */

public class MaestroTiposDoc implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long idTipoDoc36;
	private String descEs36;
	private String descEu36;
	private String roleid36;
	private String origen36;
	private Date fAlta36;
	private String usuAlta36;
	private Date fModif36;
	private String usuModif36;
	private List<MaestroTareas> maestroTareases = new ArrayList<MaestroTareas>();

	/**
	 * Method 'MaestroTiposDoc'.
	 */
	public MaestroTiposDoc() {
	}

	/**
	 * Method 'MaestroTiposDoc'.
	 * 
	 * @param idTipoDoc36 Long
	 */
	public MaestroTiposDoc(Long idTipoDoc36) {
		this.idTipoDoc36 = idTipoDoc36;
	}

	/**
	 * Method 'MaestroTiposDoc'.
	 * 
	 * @param idTipoDoc36 Long
	 * @param descEs36    String
	 * @param descEu36    String
	 * @param roleid36    String
	 * @param origen36    String
	 * @param fAlta36     Date
	 * @param usuAlta36   String
	 * @param fModif36    Date
	 * @param usuModif36  String
	 */
	public MaestroTiposDoc(Long idTipoDoc36, String descEs36, String descEu36, String roleid36, String origen36,
			Date fAlta36, String usuAlta36, Date fModif36, String usuModif36) {
		this.idTipoDoc36 = idTipoDoc36;
		this.descEs36 = descEs36;
		this.descEu36 = descEu36;
		this.roleid36 = roleid36;
		this.origen36 = origen36;
		this.fAlta36 = fAlta36;
		this.usuAlta36 = usuAlta36;
		this.fModif36 = fModif36;
		this.usuModif36 = usuModif36;
	}

	/**
	 * Method 'MaestroTiposDoc'.
	 * 
	 * @param idTipoDoc36     Long
	 * @param descEs36        String
	 * @param descEu36        String
	 * @param roleid36        String
	 * @param origen36        String
	 * @param vAlta36         Date
	 * @param usuAlta36       String
	 * @param vModif36        Date
	 * @param usuModif36      String
	 * @param maestroTareases List<MaestroTareas>
	 */
	public MaestroTiposDoc(Long idTipoDoc36, String descEs36, String descEu36, String roleid36, String origen36,
			Date vAlta36, String usuAlta36, Date vModif36, String usuModif36, List<MaestroTareas> maestroTareases) {

		this.idTipoDoc36 = idTipoDoc36;
		this.descEs36 = descEs36;
		this.descEu36 = descEu36;
		this.roleid36 = roleid36;
		this.origen36 = origen36;
		this.fAlta36 = vAlta36;
		this.usuAlta36 = usuAlta36;
		this.fModif36 = vModif36;
		this.usuModif36 = usuModif36;
		this.maestroTareases = maestroTareases;
	}

	/**
	 * Method 'getIdTipoDoc36'.
	 *
	 * @return Long
	 */

	public Long getIdTipoDoc36() {
		return this.idTipoDoc36;
	}

	/**
	 * Method 'setIdTipoDoc36'.
	 *
	 * @param idTipoDoc36 Long
	 * @return
	 */

	public void setIdTipoDoc36(Long idTipoDoc36) {
		this.idTipoDoc36 = idTipoDoc36;
	}

	/**
	 * Method 'getDescEs36'.
	 *
	 * @return String
	 */

	public String getDescEs36() {
		return this.descEs36;
	}

	/**
	 * Method 'setDescEs36'.
	 *
	 * @param descEs36 String
	 * @return
	 */

	public void setDescEs36(String descEs36) {
		this.descEs36 = descEs36;
	}

	/**
	 * Method 'getDescEu36'.
	 *
	 * @return String
	 */

	public String getDescEu36() {
		return this.descEu36;
	}

	/**
	 * Method 'setDescEu36'.
	 *
	 * @param descEu36 String
	 * @return
	 */

	public void setDescEu36(String descEu36) {
		this.descEu36 = descEu36;
	}

	/**
	 * Recupera la descipción en funcion del idioma de sesión
	 * 
	 * @return String
	 */
	@JsonIgnore
	public String getDesc() {
		if (LocaleContextHolder.getLocale().getLanguage().equalsIgnoreCase(Constantes.LOCALE_ES.getLanguage())) {
			return this.descEs36;
		} else if (LocaleContextHolder.getLocale().getLanguage().equalsIgnoreCase(Constantes.LOCALE_EU.getLanguage())) {
			return this.descEu36;
		}
		return "";
	}

	/**
	 * Method 'getRoleid36'.
	 *
	 * @return String
	 */

	public String getRoleid36() {
		return this.roleid36;
	}

	/**
	 * Method 'setRoleid36'.
	 *
	 * @param roleid36 String
	 * @return
	 */

	public void setRoleid36(String roleid36) {
		this.roleid36 = roleid36;
	}

	/**
	 * Method 'getOrigen36'.
	 *
	 * @return String
	 */

	public String getOrigen36() {
		return this.origen36;
	}

	/**
	 * Method 'setOrigen36'.
	 *
	 * @param origen36 String
	 * @return
	 */

	public void setOrigen36(String origen36) {
		this.origen36 = origen36;
	}

	/**
	 * Method 'getfAlta36'.
	 *
	 * @return java.util.Date
	 */

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getfAlta36() {
		return this.fAlta36;
	}

	/**
	 * Method 'setfAlta36'.
	 *
	 * @param fAlta36 java.util.Date
	 * @return
	 */
	@JsonDeserialize(using = JsonDateDeserializer.class)
	public void setfAlta36(Date fAlta36) {
		this.fAlta36 = fAlta36;
	}

	/**
	 * Method 'getUsuAlta36'.
	 *
	 * @return String
	 */

	public String getUsuAlta36() {
		return this.usuAlta36;
	}

	/**
	 * Method 'setUsuAlta36'.
	 *
	 * @param usuAlta36 String
	 * @return
	 */

	public void setUsuAlta36(String usuAlta36) {
		this.usuAlta36 = usuAlta36;
	}

	/**
	 * Method 'getfModif36'.
	 *
	 * @return java.util.Date
	 */

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getfModif36() {
		return this.fModif36;
	}

	/**
	 * Method 'setfModif36'.
	 *
	 * @param fModif36 java.util.Date
	 * @return
	 */
	@JsonDeserialize(using = JsonDateDeserializer.class)
	public void setfModif36(Date fModif36) {
		this.fModif36 = fModif36;
	}

	/**
	 * Method 'getUsuModif36'.
	 *
	 * @return String
	 */

	public String getUsuModif36() {
		return this.usuModif36;
	}

	/**
	 * Method 'setUsuModif36'.
	 *
	 * @param usuModif36 String
	 * @return
	 */

	public void setUsuModif36(String usuModif36) {
		this.usuModif36 = usuModif36;
	}

	/**
	 * Method 'getMaestroTareases'.
	 *
	 * @return List
	 */
	@JsonIgnore
	public List<MaestroTareas> getMaestroTareases() {
		return this.maestroTareases;
	}

	/**
	 * Method 'setMaestroTareases'.
	 *
	 * @param maestroTareases List
	 * @return
	 */
	public void setMaestroTareases(List<MaestroTareas> maestroTareases) {
		this.maestroTareases = maestroTareases;
	}

	/**
	 * Intended only for logging and debugging.
	 * 
	 * Here, the contents of every main field are placed into the result.
	 * 
	 * @return String
	 */
	@Override
	public String toString() {
		StringBuilder result = new StringBuilder();
		result.append(this.getClass().getName()).append(" Object { ");
		result.append(" [ idTipoDoc36: ").append(this.idTipoDoc36).append(" ]");
		result.append(", [ descEs36: ").append(this.descEs36).append(" ]");
		result.append(", [ descEu36: ").append(this.descEu36).append(" ]");
		result.append(", [ roleid36: ").append(this.roleid36).append(" ]");
		result.append(", [ origen36: ").append(this.origen36).append(" ]");
		result.append(", [ fAlta36: ").append(this.fAlta36).append(" ]");
		result.append(", [ usuAlta36: ").append(this.usuAlta36).append(" ]");
		result.append(", [ fModif36: ").append(this.fModif36).append(" ]");
		result.append(", [ usuModif36: ").append(this.usuModif36).append(" ]");
		result.append("}");
		return result.toString();
	}

}
