package com.ejie.ad74a.model;

import java.util.Date;

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.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * Terminales generated by UDA, 21-mar-2023 11:41:04.
 * 
 * @author UDA
 */

public class Terminales implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long idTerminal34;
	private String descEs34;
	private String descEu34;
	private Integer digital34;
	private String usuAlta34;
	private Date fAlta34;

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

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

	/**
	 * Method 'Terminales'.
	 * 
	 * @param idTerminal34 Long
	 * @param descEs34     String
	 * @param descEu34     String
	 * @param digital34    Integer
	 * @param usuAlta34    String
	 * @param fAlta34      Date
	 */
	public Terminales(Long idTerminal34, String descEs34, String descEu34, Integer digital34, String usuAlta34,
			Date fAlta34) {

		this.idTerminal34 = idTerminal34;
		this.descEs34 = descEs34;
		this.descEu34 = descEu34;
		this.digital34 = digital34;
		this.usuAlta34 = usuAlta34;
		this.fAlta34 = fAlta34;
	}

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

	public Long getIdTerminal34() {
		return this.idTerminal34;
	}

	/**
	 * Method 'setIdTerminal34'.
	 *
	 * @param idTerminal34 Long
	 * @return
	 */

	public void setIdTerminal34(Long idTerminal34) {
		this.idTerminal34 = idTerminal34;
	}

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

	public String getDescEs34() {
		return this.descEs34;
	}

	/**
	 * Method 'setDescEs34'.
	 *
	 * @param descEs34 String
	 * @return
	 */

	public void setDescEs34(String descEs34) {
		this.descEs34 = descEs34;
	}

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

	public String getDescEu34() {
		return this.descEu34;
	}

	/**
	 * Method 'setDescEu34'.
	 *
	 * @param descEu34 String
	 * @return
	 */

	public void setDescEu34(String descEu34) {
		this.descEu34 = descEu34;
	}

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

	public Integer getDigital34() {
		return this.digital34;
	}

	/**
	 * Method 'setDigital34'.
	 *
	 * @param digital34 Integer
	 * @return
	 */

	public void setDigital34(Integer digital34) {
		this.digital34 = digital34;
	}

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

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

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

	/**
	 * 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(" [ idTerminal34: ").append(this.idTerminal34).append(" ]");
		result.append(", [ descEs34: ").append(this.descEs34).append(" ]");
		result.append(", [ descEu34: ").append(this.descEu34).append(" ]");
		result.append(", [ digital34: ").append(this.digital34).append(" ]");
		result.append(", [ fAlta34: ").append(this.fAlta34).append(" ]");
		result.append(", [ usuAlta34: ").append(this.usuAlta34).append(" ]");
		result.append("}");
		return result.toString();
	}

	/**
	 * Method 'getUsuAlta34'.
	 *
	 * @return String
	 */
	public String getUsuAlta34() {
		return usuAlta34;
	}

	/**
	 * Method 'setUsuAlta34'.
	 *
	 * @param usuAlta34 String
	 * @return
	 */
	public void setUsuAlta34(String usuAlta34) {
		this.usuAlta34 = usuAlta34;
	}

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