package com.ejie.ad74a.model;

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

import org.springframework.context.i18n.LocaleContextHolder;

/**
 * MaestroTiposDatoEco generated by UDA, 02-oct-2023 12:30:29.
 * 
 * @author UDA
 */

public class MaestroTiposDatoEco implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long idTipoDatoEco61;
	private String descEs61;
	private String descEu61;
	private Integer visible61;
	private Date fAlta61;
	private String usuAlta61;
	private Date fModif61;
	private String usuModif61;

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

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

	/**
	 * Method 'MaestroTiposDatoEco'.
	 * 
	 * @param idTipoDatoEco61 Long
	 * @param descEs61        String
	 * @param descEu61        String
	 * @param visible61       Integer
	 * @param fAlta61         Date
	 * @param usuAlta61       String
	 * @param fModif61        Date
	 * @param usuModif61      String
	 */
	public MaestroTiposDatoEco(Long idTipoDatoEco61, String descEs61, String descEu61, Integer visible61, Date fAlta61,
			String usuAlta61, Date fModif61, String usuModif61) {

		this.idTipoDatoEco61 = idTipoDatoEco61;
		this.descEs61 = descEs61;
		this.descEu61 = descEu61;
		this.visible61 = visible61;
		this.fAlta61 = fAlta61;
		this.usuAlta61 = usuAlta61;
		this.fModif61 = fModif61;
		this.usuModif61 = usuModif61;
	}

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

	public Long getIdTipoDatoEco61() {
		return this.idTipoDatoEco61;
	}

	/**
	 * Method 'setIdTipoDatoEco61'.
	 *
	 * @param idTipoDatoEco61 Long
	 * @return
	 */

	public void setIdTipoDatoEco61(Long idTipoDatoEco61) {
		this.idTipoDatoEco61 = idTipoDatoEco61;
	}

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

	public String getDescEs61() {
		return this.descEs61;
	}

	/**
	 * Method 'setDescEs61'.
	 *
	 * @param descEs61 String
	 * @return
	 */

	public void setDescEs61(String descEs61) {
		this.descEs61 = descEs61;
	}

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

	public String getDescEu61() {
		return this.descEu61;
	}

	/**
	 * Method 'setDescEu61'.
	 *
	 * @param descEu61 String
	 * @return
	 */

	public void setDescEu61(String descEu61) {
		this.descEu61 = descEu61;
	}

	/**
	 * Method 'getVisible61'.
	 *
	 * @return Integer
	 */

	public Integer getVisible61() {
		return this.visible61;
	}

	/**
	 * Method 'setVisible61'.
	 *
	 * @param visible61 Integer
	 * @return
	 */

	public void setVisible61(Integer visible61) {
		this.visible61 = visible61;
	}

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

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

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

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

	public String getUsuAlta61() {
		return this.usuAlta61;
	}

	/**
	 * Method 'setUsuAlta61'.
	 *
	 * @param usuAlta61 String
	 * @return
	 */

	public void setUsuAlta61(String usuAlta61) {
		this.usuAlta61 = usuAlta61;
	}

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

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

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

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

	public String getUsuModif61() {
		return this.usuModif61;
	}

	/**
	 * Method 'setUsuModif61'.
	 *
	 * @param usuModif61 String
	 * @return
	 */

	public void setUsuModif61(String usuModif61) {
		this.usuModif61 = usuModif61;
	}

	/**
	 * 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(" [ idTipoDatoEco61: ").append(this.idTipoDatoEco61).append(" ]");
		result.append(", [ descEs61: ").append(this.descEs61).append(" ]");
		result.append(", [ descEu61: ").append(this.descEu61).append(" ]");
		result.append(", [ visible61: ").append(this.visible61).append(" ]");
		result.append(", [ FAlta61: ").append(this.fAlta61).append(" ]");
		result.append(", [ usuAlta61: ").append(this.usuAlta61).append(" ]");
		result.append(", [ FModif61: ").append(this.fModif61).append(" ]");
		result.append(", [ usuModif61: ").append(this.usuModif61).append(" ]");
		result.append("}");
		return result.toString();
	}

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