package com.ejie.ad74a.model;

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

import org.springframework.context.i18n.LocaleContextHolder;

import com.ejie.ad74a.constantes.Constantes;
import com.fasterxml.jackson.annotation.JsonIgnore;

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

public class MaestroTramites implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long idTramite37;
	private String descEs37;
	private String descEu37;
	private List<MaestroTareas> maestroTareases = new ArrayList<MaestroTareas>();
	private List<TramitesExpediente> tramitesExpedientes = new ArrayList<TramitesExpediente>();

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

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

	/**
	 * Method 'MaestroTramites'.
	 * 
	 * @param idTramite37 Long
	 * @param descEs37    String
	 * @param descEu37    String
	 */
	public MaestroTramites(Long idTramite37, String descEs37, String descEu37) {
		this.idTramite37 = idTramite37;
		this.descEs37 = descEs37;
		this.descEu37 = descEu37;
	}

	/**
	 * Method 'MaestroTramites'.
	 * 
	 * @param idTramite37         Long
	 * @param descEs37            String
	 * @param descEu37            String
	 * @param maestroTareases     List<MaestroTareas>
	 * @param tramitesExpedientes List<TramitesExpediente>
	 */
	public MaestroTramites(Long idTramite37, String descEs37, String descEu37, List<MaestroTareas> maestroTareases,
			List<TramitesExpediente> tramitesExpedientes) {

		this.idTramite37 = idTramite37;
		this.descEs37 = descEs37;
		this.descEu37 = descEu37;
		this.maestroTareases = maestroTareases;
		this.tramitesExpedientes = tramitesExpedientes;
	}

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

	public Long getIdTramite37() {
		return this.idTramite37;
	}

	/**
	 * Method 'setIdTramite37'.
	 *
	 * @param idTramite37 Long
	 * @return
	 */

	public void setIdTramite37(Long idTramite37) {
		this.idTramite37 = idTramite37;
	}

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

	public String getDescEs37() {
		return this.descEs37;
	}

	/**
	 * Method 'setDescEs37'.
	 *
	 * @param descEs37 String
	 * @return
	 */

	public void setDescEs37(String descEs37) {
		this.descEs37 = descEs37;
	}

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

	public String getDescEu37() {
		return this.descEu37;
	}

	/**
	 * Method 'setDescEu37'.
	 *
	 * @param descEu37 String
	 * @return
	 */

	public void setDescEu37(String descEu37) {
		this.descEu37 = descEu37;
	}

	/**
	 * 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;
	}

	/**
	 * Method 'getTramitesExpedientes'.
	 *
	 * @return List
	 */
	@JsonIgnore
	public List<TramitesExpediente> getTramitesExpedientes() {
		return this.tramitesExpedientes;
	}

	/**
	 * Method 'setTramitesExpedientes'.
	 *
	 * @param tramitesExpedientes List
	 * @return
	 */
	public void setTramitesExpedientes(List<TramitesExpediente> tramitesExpedientes) {
		this.tramitesExpedientes = tramitesExpedientes;
	}

	/**
	 * Method 'getDesc'.
	 *
	 * @return String
	 */
	public String getDesc() {
		if (LocaleContextHolder.getLocale().getLanguage().equalsIgnoreCase(Constantes.LOCALE_ES.getLanguage())) {
			return this.getDescEs37();
		} else if (LocaleContextHolder.getLocale().getLanguage().equalsIgnoreCase(Constantes.LOCALE_EU.getLanguage())) {
			return this.getDescEu37();
		}
		return "";
	}

	/**
	 * 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(" [ idTramite37: ").append(this.idTramite37).append(" ]");
		result.append(", [ descEs37: ").append(this.descEs37).append(" ]");
		result.append(", [ descEu37: ").append(this.descEu37).append(" ]");
		result.append("}");
		return result.toString();
	}

}
